From a54268e0791b6df64205c8f18463ad9e31ba1864 Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Sat, 16 Apr 2022 21:13:34 +1000 Subject: [PATCH] Fixes issues in #4 with IND sector. Fixed missing DEP TMA volumes. Removed debug logging --- iso2dec.js | 1 - public/sectormap.js | 13 ++++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/iso2dec.js b/iso2dec.js index 49cce2d..b3a6f2f 100644 --- a/iso2dec.js +++ b/iso2dec.js @@ -41,7 +41,6 @@ function idl(latitude,longitude){ // Since we don't know about lines, only points we clobber all points to suit Australia. if(longitude < -100){ longitude = longitude + 360; - console.log(longitude); } return {latitude: latitude, longitude: longitude}; } diff --git a/public/sectormap.js b/public/sectormap.js index 0c919ff..29dd647 100644 --- a/public/sectormap.js +++ b/public/sectormap.js @@ -111,26 +111,21 @@ function mergeBoundaries(sector) { } } -function unionArray(array) { - const bufferKm = 0.2; +function unionArray(array){ var featureCollection = turf.featureCollection(array); if (featureCollection.length === 0) { return null } - // buffer is a dirty dirty hack to close up some holes in datasets - let ret = turf.buffer(featureCollection.features[0], bufferKm, { units: 'kilometers' }); - // let ret = featureCollection.features[0]; + let ret = featureCollection.features[0]; turf.featureEach(featureCollection, function (currentFeature, featureIndex) { if (featureIndex > 0) { - ret = turf.union(ret, turf.buffer(currentFeature, bufferKm, { units: 'kilometers' })) - // ret = turf.union(ret, currentFeature); + ret = turf.union(ret, currentFeature); } }); // Remove any holes added in union ret.geometry.coordinates.length = 1; - return ret; }; @@ -184,7 +179,7 @@ async function getATCSectors() { var tmaSectors = []; sectorsJson.forEach(sector => { - if (sector.Callsign.includes("APP")) { + if (sector.Callsign.includes("APP") || sector.Callsign.includes("DEP")) { var sector = mergeBoundaries(sector); if (sector != false) { tmaSectors.push(sector);