New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WKT1 format for CRS84 from GDAL results in EPSG:4326 with lon/lat axis order #475
Comments
Interesting.
Yes, that is the case. Probably need to raise this issue upstream. |
cc @rouault |
Yes, this is a fuzzy area... "GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]" is the canonical representation of EPSG:4326 in ESRI WKT. So identification to it is OK. For some reason I don't really remember, I preferred that on import of such a WKT without an explicit axis order, we use traditional axis order "long", "lat". Not really sure what would be the impact of changing this |
I think what I find most unexpected (without knowing the background you just sketched) is that it gives EPSG:4326 with full confidence, while the axis order does not match:
While for a similar object (reconstructed by roundtripping to WKT2), needs a min_confidence of 20 to ignore the axis order to return EPSG:4326:
|
But thanks for the explanation of the context! In any case, it's thus not a pyproj issue, so closing here. |
Or more generally formulations that don't have an explicit axis order. Refs pyproj4/pyproj#475 projinfo 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]' returns EPSG:4326 with 100% confidence. But its axis order is not the same as EPSG:4326. I've pondered about this, like decreasing the confidence of the match, but this would have downstream effects on GDAL (shapefiles with the above content in a .prj would no longer be identified as EPSG:4326). So for now, document that oddity.
Or more generally formulations that don't have an explicit axis order. Refs pyproj4/pyproj#475 projinfo 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]' returns EPSG:4326 with 100% confidence. But its axis order is not the same as EPSG:4326. I've pondered about this, like decreasing the confidence of the match, but this would have downstream effects on GDAL (shapefiles with the above content in a .prj would no longer be identified as EPSG:4326). So for now, document that oddity.
From Toblerity/Fiona#816 (comment), I noticed that the WKT that was produced by Fiona / GDAL for the "urn:ogc:def:crs:OGC:1.3:CRS84" has a strange behaviour when read in pyproj:
So you can see that the axis order is correct I think (lon, lat), as this is coming from CRS84 (which should be EPSG:4326 but with swapped axis). But it still directly recognizes this as EPSG:4326 (it's even in the first line of the repr).
Which seemingly gives a CRS that contradicts itself? (this probably is a behaviour defined by PROJ though)
The text was updated successfully, but these errors were encountered: