4

In an open-source tracking project that uses WKT in its API, we have a debate about what is the correct order for representing geographical coordinates. Lat and then Long or Long and than Lat.

In most popular libraries and documentation I saw, the prevalent order is Long first (Long, Lat).

But looking through the official documentation of WKT I cannot locate the official order.

Can someone point me to the specific documentation or other qualified sources of information?

2
  • 3
    {X,Y} order if the only order I've seen or used. If it's not written down then there are exceptions that make the opposite valid. KML and a few others make an explicit order; others like GML force you tag the values, which makes them that much more inefficient. I doubt you'll get a definitive answer, but you'd need a really good reason to not use {lon,lat}.
    – Vince
    Jul 5, 2020 at 4:33
  • 1
    MySQL 8 started to use WKT in the official EPSG order. All other software that I know are using long/lat or easting/northing order.
    – user30184
    Jul 5, 2020 at 9:39

2 Answers 2

7

For the axis order for any coordinate reference system where EPSG is the authority, you should use their registry https://epsg.org/home.html

For example for epsg:4326 (https://epsg.org/crs/wkt/id/4326).

The WKT output shows that for EPSG:4326 the axis order is lat/long

GEODCRS["WGS 84",
  DATUM["World Geodetic System 1984",
    ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1.0]]],
  CS[ellipsoidal,2],
    AXIS["latitude",north,ORDER[1]],
    AXIS["longitude",east,ORDER[2]],
    ANGLEUNIT["degree",0.01745329252],
  ID["EPSG",4326]]

Most EPSG geographic coordinate systems follow the latitude then longitude, coordinate axis order, following the default of ISO 6709 Standard representation of geographic point location by coordinates

Order, positive direction, and units of coordinates are supposed to be defined by the CRS. When CRS identification is missing, the data must be interpreted by the following conventions:

Latitude comes before longitude

North latitude is positive

East longitude is positive

Fraction of degrees is preferred in digital data exchange, while sexagesimal notation is tolerated for compatibility

ref: https://en.wikipedia.org/wiki/ISO_6709

7
  • 5
    I do not quite agree with WKT. The standard portal.opengeospatial.org/files/?artifact_id=25355 does not say much about the coordinate order and majority of sofware that deal with WKT use systematically longitude/latitude or easting/northing order. It may be wrong but changing the order would mainly add confusion.
    – user30184
    Jul 5, 2020 at 9:49
  • 1
    @user30184 The Simple Features specification states that axes order must be interpreted according to the CRS. It is true that some software packages do not comply to the specification, but that does not justify insisting on this mistake. Other standards like GeoSPARQL or GML are even more strict in this regard, as are other ISO specifications. May 3, 2022 at 8:00
  • This discussion does not seem to forward a bit and I know that I repeat my own words. The first WKT standard from 1999 did not say anything about axis order, just that there are "x" and "y". It was later added, without making a new WKT version, "The interpretation of the coordinates is subject to the coordinate reference systems associated to the point". Currently it is impossible to say what the WKT POINT (40 50) means without external information about the CRS, and when the WKT was written. GML of course is another story, and is has an explicit way to include CRS and GML version.
    – user30184
    May 3, 2022 at 8:51
  • @nmtoken, when I visit the link https://epsg.org/crs/wkt/id/4326, I don't see the words "ORDER[1]" anywhere in the WKT description of the CRS. Did you add those terms yourself?
    – bixb0012
    Jul 18, 2022 at 13:53
  • @bixb0012, I didn't add them I copied the text at the time.
    – nmtoken
    Jul 18, 2022 at 14:58
0

This whole discussion seems confusing. I am using PostGIS/QGIS 4326 and am writing wkt point geometries as POINT(long lat). Been doing it for years with success.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.