Bug report #18968

All GeoCCS names imported from GDAL in srs.db are wrongly set to "Imported from GDAL"

Added by Andrea Giudiceandrea over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Projection Support
Affected QGIS version:3.1(master) Regression?:No
Operating System: Easy fix?:Yes
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:26799

Description

Like reported in #17941 (for Geographic Coordinate Systems, "GEOGCS"), I've also found that the name of each Geocentric Coordinate System ("GEOCCS") imported in srs.db from GDAL *.csv EPSG support files by QgsCoordinateReferenceSystem::syncDb() in QGIS 2.18 and QgsCoordinateReferenceSystem::syncDatabase() in QGIS 3 (during postinstall, in Windows by crssync.exe) is wrongly set to "Imported from GDAL" instead of with its proper name.

The bug lies in https://github.com/qgis/QGIS/blob/release-2_18/src/core/qgscoordinatereferencesystem.cpp#L1810-L1812

QString name( OSRIsGeographic( crs ) ? OSRGetAttrValue( crs, "GEOGCS", 0 ) : OSRGetAttrValue( crs, "PROJCS", 0 ) );
if ( name.isEmpty() )
name = QObject::tr( "Imported from GDAL" );

I think we can easily fix it:

QString name( OSRIsGeographic( crs ) ? OSRGetAttrValue( crs, "GEOGCS", 0 ) : OSRGetAttrValue( crs, "PROJCS", 0 ) );
if ( name.isEmpty() )
name = ( OSRIsGeocentric( crs ) ? OSRGetAttrValue( crs, "GEOCCS", 0 ) : QObject::tr( "Imported from GDAL" ) );

Anyway, to fix the names of the GEOCCSs already in srs.db shipped with both QGIS 2.18 and QGIS 3 we'll need to properly update it and upload it in the repository.

Associated revisions

Revision 7576ae10
Added by Jürgen Fischer over 6 years ago

crssync:
  • also update coordinate system descriptions
  • retrieve descriptions of geocentric CRSes (fixes #18968)

History

#2 Updated by Jürgen Fischer over 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF