MySQL GIS Lat/Lon to X/Y: which is which?
-
20-09-2019 - |
Question
Is there a convention for whether GIS points in MySQL should be stored as POINT($latitude $longitude)
or POINT($longitude $latitude)
?
Having longitude correspond to X on a cartesian map would visually make more sense with north pointing up, but common parlance is to say "latitude and longitude."
Solution
In MySQL you will probably use the GeomFromText()
function to insert data in a spatial field. This function uses the WKT (Well-Known Text) format to define the geometries, and in the POINT case, it is defined as:
POINT ($longitude $latitude)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow