The points in Linestring in Postgis (imported from osm by osm2pgsql) is described by the order (longitude, latitude)
for example a Linestring in Munich Map
'LINESTRING(11.4068032 47.8580927,11.4067187 47.8580965)'
How could I reverse the order to normal (latitude, longitude) ? Is (longitude, latitude) very odd order ? Because I see popular Map API all use (latitude, longitude) order
You can use ST_FlipCoordinates to return a version of the given geometry with X and Y axis flipped.
Keep in mind, you generally want to keep the axis order (longitude, latitude), which is the correct axis order for PostGIS. Flipping it to (latitude, longitude) will generally break things.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With