×

Notice

The forum is in read only mode.

REST API with longitude w Negative numbers fails

5 years 6 months ago - 5 years 6 months ago #761 by mikero1955
Hello, I've been trying to write an app that displays aircraft info using the rest functions lomin, lomax, lamin, lamax like thus.
opensky-network.org/api/states/all?lamin....3382&lomax=129.8863
This works just fine as long as the lomax / lomin are positive numbers and should give all aircraft somewhere over Taiwan.
But if you change the lomin / lomax to be negative (Somewhere near San Jose CA) it fails to return any states.
opensky-network.org/api/states/all?lamin...3382&lomax=-129.8863

Is this a bug or am I just using it incorrectly?
Thanks,
Mike
5 years 6 months ago #763 by meides
Hey Mike,

since you are passing negative numbers -129.8863 is actually smaller than -118.8863. Switch the min and max values:

opensky-network.org/api/states/all?lamin...3382&lomax=-118.8863

Best,
Marco
The following user(s) said Thank You: mikero1955
5 years 6 months ago #767 by mikero1955
Many thanks, I cannot believe I didn't get that!
Powered by Kunena Forum