Skip to content

Commit dc84c87

Browse files
committedJun 11, 2019
Only use internal crs definition files for GDAL >= 3 builds
1 parent e64b3f8 commit dc84c87

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
 

‎src/core/qgscoordinatereferencesystem.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,12 @@ bool QgsCoordinateReferenceSystem::loadIds( QHash<int, QString> &wkts )
17731773

17741774
Q_FOREACH ( const QString &csv, QStringList() << "gcs.csv" << "pcs.csv" << "vertcs.csv" << "compdcs.csv" << "geoccs.csv" )
17751775
{
1776-
QString filename = QgsApplication::pkgDataPath() + QStringLiteral( "/resources/" ) + csv;
1776+
1777+
#if GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(3,0,0)
1778+
const QString filename = CPLFindFile( "gdal", csv.toUtf8() );
1779+
#else
1780+
const QString filename = QgsApplication::pkgDataPath() + QStringLiteral( "/resources/" ) + csv;
1781+
#endif
17771782

17781783
QFile f( filename );
17791784
if ( !f.open( QIODevice::ReadOnly ) )
@@ -2159,8 +2164,13 @@ int QgsCoordinateReferenceSystem::syncDatabase()
21592164

21602165
bool QgsCoordinateReferenceSystem::syncDatumTransform( const QString &dbPath )
21612166
{
2167+
#if GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(3,0,0)
2168+
const char *filename = CSVFilename( "datum_shift.csv" );
2169+
FILE *fp = VSIFOpen( filename, "rb" );
2170+
#else
21622171
const QString filename = QgsApplication::pkgDataPath() + QStringLiteral( "/resources/datum_shift.csv" );
21632172
FILE *fp = VSIFOpen( filename.toUtf8().constData(), "rb" );
2173+
#endif
21642174
if ( !fp )
21652175
{
21662176
return false;

0 commit comments

Comments
 (0)
Please sign in to comment.