Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove clearance requests for aircraft already deep in oceanic airspace #33

Open
erikquinn opened this issue Feb 6, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@erikquinn
Copy link

From Mark Eijkens:

No longer display flights who have entered the oceanic like X amount of minutes ago already (say ~30).

This could be done in a few ways...

  • simply remove clearance requests for aircraft that have ETAs over the OEPs that are >n minutes old
  • define a polygon by an array of lat/lon coordinates, defining "the ocean", and check if the aircraft is within that polygon
  • define a boundary line demarcating "the ocean" from "not the ocean yet" 😄 and use a similar method to tell if they've crossed the line yet. This seems programatically tricky and potentially unreliable though. See here for an example.
  • variation on the last one: define all the OEPs, each a/c measure distance to all OEPs, find closest, find heading from that fix to aircraft-- if east of that fix, a/c is "in the ocean", and then just check the mileage

Either external libraries like turf.js etc could be the answer if planning to use other features in the future, or just use a simple guy like this from stackoverflow:

pt[lat,long]

function isPointInPoly(poly, pt){
    for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)
        ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1] < poly[i][1]))
        && (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])
        && (c = !c);
    return c;
}
@erikquinn erikquinn added the enhancement New feature or request label Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant