-
Notifications
You must be signed in to change notification settings - Fork 12
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
Negative 0 coordinates #17
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you try to load negative 0 coordinate (f.e. -0.9160958), the result will be positive.
The reason for it is mainly caused by expressions like this:
coordinate.degrees >= 0
For background information you can check this:
are 0 and -0 the same
This is resolved in ES2015, but unfortunately that one is not yet widely implemented.
There would be quite a number of changes to the code to make it work properly (which is why I am not sure if I should submit a patch).
One solution would be using a function like this for the positivity test:
var positiveNumber = function(value) { return ((1/value) === (1/Math.abs(value))); }
PS: I am no expert in GIS or coordinates systems, but I thought that minutes and seconds cannot be negative. I see some tests of their positivity and that seem off to me...
The text was updated successfully, but these errors were encountered: