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

classic Classic list List threaded Threaded
6 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
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
Reply | Threaded
Open this post in threaded view
|

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

andreaerdna
In reply to this post by Even Rouault-2
Do you think it would be appropriate and safe to back port in 2.3 brach the
commits [0] about the name of deprecated GeoGCSs and GeoCCSs, now that 2.3.1
version is scheduled?


[0]
- "importFromEPSG(): append ' (deprecated)' at end of deprecated GeoCCS
(#646)"
8cd283e19208fe6e0276adc4e3a7f54fcc30ed54
<https://github.com/OSGeo/gdal/commit/8cd283e19208fe6e0276adc4e3a7f54fcc30ed54>  
- "Merge pull request #575 from rouault/deprecated_gcs"
01369046d8780d34f722c7011789cda409fe07df
<https://github.com/OSGeo/gdal/commit/01369046d8780d34f722c7011789cda409fe07df>  
- "importFromEPSG(): append ' (deprecated)' at end of deprecated GCS"
2db4413faeeecb81c3c9951a9c8b750d8a9a679e
<https://github.com/OSGeo/gdal/commit/2db4413faeeecb81c3c9951a9c8b750d8a9a679e>  



-----
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
Reply | Threaded
Open this post in threaded view
|

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

Even Rouault-2
On samedi 9 juin 2018 03:19:30 CEST andreaerdna wrote:
> Do you think it would be appropriate and safe to back port in 2.3 brach the
> commits [0] about the name of deprecated GeoGCSs and GeoCCSs, now that 2.3.1
> version is scheduled?

Andrea,

Those are functional changes that could potentially break code that would rely
on the CRS name without the " (deprecated)" suffix.

Even

>
>
> [0]
> - "importFromEPSG(): append ' (deprecated)' at end of deprecated GeoCCS
> (#646)"
> 8cd283e19208fe6e0276adc4e3a7f54fcc30ed54
> <https://github.com/OSGeo/gdal/commit/8cd283e19208fe6e0276adc4e3a7f54fcc30ed
> 54> - "Merge pull request #575 from rouault/deprecated_gcs"
> 01369046d8780d34f722c7011789cda409fe07df
> <https://github.com/OSGeo/gdal/commit/01369046d8780d34f722c7011789cda409fe07
> df> - "importFromEPSG(): append ' (deprecated)' at end of deprecated GCS"
> 2db4413faeeecb81c3c9951a9c8b750d8a9a679e
> <https://github.com/OSGeo/gdal/commit/2db4413faeeecb81c3c9951a9c8b750d8a9a67
> 9e>
>
>
>
> -----
> 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


--
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
> Those are functional changes that could potentially break code that would
> rely
> on the CRS name without the " (deprecated)" suffix.

Even, thanks for the clarification.

Best reguards.



-----
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