Skip to content
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

add more doc -- not sure about latitude and longitude #62

Open
kasir-barati opened this issue Dec 8, 2023 · 0 comments
Open

add more doc -- not sure about latitude and longitude #62

kasir-barati opened this issue Dec 8, 2023 · 0 comments

Comments

@kasir-barati
Copy link

kasir-barati commented Dec 8, 2023

It might sounds a bit weird but it is nonetheless true, I always think whether the first item in the coordinates is latitude or longitude

const position = '0101000020E61000003333333333331F409A99999999D94A40'
const buffer = Buffer.from(position, "hex")
const geometry = wkx.Geometry.parse(buffer)
const transformedPosition = geometry.toGeoJSON() 
console.log(
  'lat': transformedPosition.coordinates[0],
  'lng': transformedPosition.coordinates[1]
)

So I really appreciate it if you could mention it in the doc and answer me here. Is my assumption correct.

*I know in google map it is [lat, lng]
*But in PostGIS which is my DB too it is the other way around, [lng, lat]. Also there it says:

In web mapping APIs like Google Maps, spatial coordinates are 🔴often🔴 in order of latitude then longitude.

*And in mongodb it is also `[lat, lng]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant