REST API with longitude w Negative numbers fails

3 years 9 months ago - 3 years 9 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

Please Log in or Create an account to join the conversation.

3 years 9 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

Please Log in or Create an account to join the conversation.

3 years 9 months ago #767 by mikero1955
Many thanks, I cannot believe I didn't get that!

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
This website uses cookies to offer you the best experience of our services. By using this website you agree to our privacy policy!