[gdal-dev] About deprecated CRS and the different behavior of EPSGGetPCSInfo and EPSGGetGCSInfo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] About deprecated CRS and the different behavior of EPSGGetPCSInfo and EPSGGetGCSInfo

andreaerdna
Hi all,
trying to investigate two QGIS bugs [1,2], I noticed that EPSGGetPCSInfo and
EPSGGetGCSInfo (ogr\ogr_fromepsg.cpp) behave differently in the way they
deal with deprecated CRS.

In particular, while EPSGGetPCSInfo [3] appends the string " deprecated" to
the CRS name when it's flagged as deprecated in pcs.csv, EPSGGetGCSInfo [4]
does not.
This IMHO leads to some inconsistencies in how OSRImportFromEPSG and
OGRSpatialReference::importFromEPSG() initialize SRS based on EPSG GCS or
PCS code.

The behavior of EPSGGetPCSInfo was modified long ago [5] and I was not able
to trace the reason for this change and, above all, the reason why
EPSGGetGCSInfo was not modified in the same way. Anybody knows?

Anyway, I wonder if is not the case to modify also EPSGGetGCSInfo in order
to append " deprecated" to the deprecated GCSs names as EPSGGetPCSInfo does
for PCSs, or if there are some reasons for not doing so.

Hope this could help improve GDAL.

Andrea


[1] "Hide deprecated CRSs" functionality not working properly in the
Coordinate Reference System Selector dialog
https://issues.qgis.org/issues/18896
[2] Deprecated CRSs: inconsistencies in srs.db and in its update process
https://issues.qgis.org/issues/18905
[3]
https://github.com/OSGeo/gdal/blob/release/2.2/gdal/ogr/ogr_fromepsg.cpp#L958-L978
[4]
https://github.com/OSGeo/gdal/blob/release/2.2/gdal/ogr/ogr_fromepsg.cpp#L640-L648
[5] added deprecated PCS name if it is deprecated
https://github.com/OSGeo/gdal/commit/39ce2084e05d494deafb93b977a7c4c6c0b36417



-----
Andrea Giudiceandrea
--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Andrea Giudiceandrea
Reply | Threaded
Open this post in threaded view
|

Re: About deprecated CRS and the different behavior of EPSGGetPCSInfo and EPSGGetGCSInfo

Even Rouault-2

Hi,

 

It looks to me like a good idea to add deprecated to GCS names too.

Implemented per https://github.com/OSGeo/gdal/pull/575

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: About deprecated CRS and the different behavior of EPSGGetPCSInfo and EPSGGetGCSInfo

andreaerdna
Even Rouault-2 wrote
> Implemented per https://github.com/OSGeo/gdal/pull/575

Thanks, Even!

Taking a better look at importFromEPSG and how it's used by QGIS
QgsCoordinateReferenceSystem::syncDb(), I think that it will be useful to
uniform also the names of deprecated **GEOCCS** (Geocentric Coordinate
Systems) implementing your fix in **SetEPSGGeocCS** ('cause there's no
"EPSGGetGCCSInfo") too.

Just for completeness, the behavior of SetEPSGCompdCS and SetEPSGVertCS
(that are also used by importFromEPSG) about deprecated CS does not affect
QgsCoordinateReferenceSystem::syncDb(): in fact for compound coordinate
system (COMPD_CS), syncDB always use the related horizontal projcs or geogcs
name, while for vertical coordinate system it does not care of the name.

Best regards and good work.



-----
Andrea Giudiceandrea
--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Andrea Giudiceandrea