Skip to content

Negative 0 coordinates #17

@cvaida

Description

@cvaida

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions