Skip to content

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

Description

@kasir-barati

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]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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