Lon / Lat When using the POINT spatial type with MySQL

What is the correct order when installing POINT in MySQL?

Even the answers in the SO questions are different about this: Moving columns of lat / lon text to a dot column

it

POINT(lat lon) 

or

 POINT(lon lat) 

So far, as I see it, this should be the first version (lat lon), since POINT takes x and y as parameters, but I could not find any specific evidence.

+7
source share
2 answers

As seen here qaru.site/questions/302102 / ... order is equal to (lon lat).

lon is mainly the y and lat x axis if I look at my globe, but lon move along the x and lat axis along the y axis , so I think that’s why you use (lon lat)

Despite this, if you remain constant in your application, it does not matter if the world is upside down inside your db; -)

+2
source

Technically, that doesn't matter. You store the x and y coordinates of the point. You just need to read them the way you write them.

If you care about the “right path”, I can only refer to the fact that the Google Maps API creates a classroom using

 var location = new google.maps.LatLng(lat, lng); 

and at school you will also learn about “breadth and login”, and not about the other.

However, technically this does not really mean how you store them. Just make sure you use the same convention when you read them.

-2
source

All Articles