Skip to content

Commit

Permalink
Fixes issues in #4 with IND sector. Fixed missing DEP TMA volumes. Re…
Browse files Browse the repository at this point in the history
…moved debug logging
  • Loading branch information
Kahn committed Apr 16, 2022
1 parent 67ce03d commit a54268e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion iso2dec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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};
}
Expand Down
13 changes: 4 additions & 9 deletions public/sectormap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a54268e

Please sign in to comment.