4 ms·
It's trivial plumbing, but is it efficient? I can't see the full details of the states/all API call in the code screenshot but it appears to be iterating throu
by dingaling 3y ago
It's trivial plumbing, but is it efficient?
I can't see the full details of the states/all API call in the code screenshot but it appears to be iterating through the entire dataset of Open Sky Network flights and for each one determining if it is within the observable radius.
That's a lot of work and inefficiency and could hit the API rate limits.
A more efficient approach would be to call the states/all API passing a bounding box ( supported by the API ) and then just eliminating any aircraft that fall within the disjunction of the bounding box and the observable radius ( the corners ).