-
Notifications
You must be signed in to change notification settings - Fork 780
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
GDA2020 identification failure #1911
Comments
And now I find https://gdal.org/tutorials/wktproblems.html#datum-names -- so it's evidently a known difference with ESRI WKT handling. Perhaps the bug here is that proj's identify isn't correctly handling ESRI WKT 1 variants? |
WKT handling has been rewritten from scratch in PROJ compared to GDAL 2, so no wonder there are differences :-)
We could argue the bug is in ESRI database itself. Looking at their official database of geographic CRS:
it seems the official name for datum GDA94 is D_GDA_1994, but for GDAL2020 it is GDA2020 without leading D_ Confirmed also by
Or perhaps they have changing datum names in different ArcGIS versions, and the DB fails to capture old names... |
Right -- the emphasis there was on "a known difference with ESRI WKT handling" - I was initially unsure if these files were being created by some other tool. I wasn't pointing the blame at PROJ! 😉 Looking at https://github.com/OSGeo/gdal/blob/d5f6bb89b0e0db0a06489419050d432e8f58ff47/gdal/data/gdal_datum.csv - there was quite a comprehensive db of known ESRI datum names. Perhaps those should be included in the proj alias tables too? |
I'd expect most of those to be hopefully already included in the alias table, but there are perhaps holes. Good exercise for a willing contributor :-) |
I'm willing to give that a shot -- is there anyway from public API to query the alias table or obtain a datum from name? |
==> proj_create_from_name() |
Ok, there's only three entries in the gdal 2 file which don't have corresponding alias entries:
The first two don't have any corresponding entries in geodetic_datum, so that leaves just the missing "D_Bern_1898" alias for EPSG:6801. |
is this a good place to say that in QGIS, 3.32, shp layer in 7844 gets loaded weirdly, even ones saved by QGIS itself. It projects the data at the right place, but the epsg is not given when hovering a layer in the browser. In Source, the CRS shows only has GCS_GDA2020. It does bring problems in pyqgis when using layer.crs().authid() which is returned has empty, only layer.crs().description() returns GCS_GDA2020 |
@lgouzin is this the CRS defintion you have? projinfo EPSG:7844 -o wkt1_esri -q
GEOGCS["GCS_GDA2020",DATUM["GDA2020",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] The WKT string in the unit test added in #1915 for GDA2020 is different from the string produced directly by PROJ in ESRI format. I don't know if it was in purpose or not.
|
yes, same CRS definition. It comes with a warning though.
|
A shapefile identified by ArcGIS as having GDA2020 CRS (EPSG:7844) has the .prj contents:
Plugging this into
projinfo --identify
does not identify this as EPSG:7844:Seems the different vs
projinfo EPSG:7844 -o WKT1:ESRI
is:GDA2020 (prj) vs GCS_GDA2020 (projinfo)
D_GDA2020 (prj) vs GDA2020 ) (projinfo)
Indeed, changing the prj WKT string to
correctly gives a EPSG:7844 100% match, so the GCS_GDA2020 difference seems irrelevant.
This looks similar to #1829, in that the spheroid name is prefixed with "D_". Some tool out there is creating shapefiles with WKT using these prefixes, so I think proj should be tolerant to this and add D_ variants to its list of known aliases.
The text was updated successfully, but these errors were encountered: