I have been importing polygon data on PostGIS but started to wonder if I had input latitude/longitude in the right order. On PostGIS doc there is a page https://postgis.net/2013/08/18/tip_lon_lat/ that clearly states spatial database records longitude as x and latitude as y, which after reflection does make sense. It's also written on https://postgis.net/docs/ST_MakePoint.html "For geodetic coordinates, X is longitude and Y is latitude".
My confusion comes from the fact that I did import data with latitude/longitude as x/y. For example:
Text: POINT(36.060409 -79.816702)
X: 36.060409
Y: -79.816702
a point near Greensboro in the US.
So according to PostGIS, X is longitude and Y is latitude, but if I plot this it gives me a point in Antarctica. If I plot on Google map, as is (.i.e 36.060409, -79.816702), which does get coordinates as latitude,longitude, then the location is correct.
I am confused about how PostGIS records the data and how am I supposed to input it?
I use PostgreSQL 12, PostGIS 3.1.0 and SRID 4326
POLYGON
in Austria that was retrieved usingST_AsText
:POLYGON((14.2940925198263 47.8925784983472,[...]))
. Clearly X is longitude and Y is latitude. – Stefan Feb 3 at 12:17