StephanGeorg / staticmaps

A Node.js library for creating map images with markers, polylines, polygons and text.
MIT License
167 stars 49 forks source link

Order of latitude and longitude in geographic coordination #49

Closed gihan9a closed 3 years ago

gihan9a commented 3 years ago

When I was using this library I noticed that the order of the latitude and longitude coordination used in the reverse format. i.e longitude before latitude.

https://github.com/StephanGeorg/staticmaps#addmarker-options

image

As I more research on this matter I found the coordination standard order is Latitude, Longitude format.

ISO 6709 https://en.wikipedia.org/wiki/ISO_6709#Order,_sign,_and_units

There's a StackOverflow question asking the same matter and the answers are leading to use latitude first in the order. https://stackoverflow.com/q/7309121/625144

So I'm curious to know why latitude and longitude are used in longitude, latitude order 🤔

StephanGeorg commented 3 years ago

Hi @gihan10

When I was using this library I noticed that the order of the latitude and longitude coordination used in the reverse format. i.e longitude before latitude.

No, it is not in reverse order because there is no order for coordinates. See more lon lat lon lat

ISO 6709 https://en.wikipedia.org/wiki/ISO_6709#Order,_sign,_and_units

The ISO standard specifically only applies to form inputs, not storage mechanisms, software or formats.

I'm using geojson internally (see example) and thus it's in the right order.

But I totally agree with you it would be much easier when there was only one single order in every system.

gihan9a commented 3 years ago

Thank you for the explanation. Maybe majority of tools that I've used were using latitude, longitude order and that's why I was feeling it's in reverse order.