From 5c95c5f7f3f03d5744b59f02bb6b1327b22247c4 Mon Sep 17 00:00:00 2001 From: nirvn Date: Tue, 18 Feb 2020 15:00:37 +0700 Subject: [PATCH] [georeferencer] Fix wrong target CRS using GDAL3/PROJ6 builds --- src/plugins/georeferencer/qgsimagewarper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/georeferencer/qgsimagewarper.cpp b/src/plugins/georeferencer/qgsimagewarper.cpp index ac0d89160af..0fc7f8d05ff 100644 --- a/src/plugins/georeferencer/qgsimagewarper.cpp +++ b/src/plugins/georeferencer/qgsimagewarper.cpp @@ -97,7 +97,11 @@ bool QgsImageWarper::createDestinationDataset( const QString &outputName, GDALDa if ( crs.isValid() ) { OGRSpatialReference oTargetSRS; +#if PROJ_VERSION_MAJOR>=6 + oTargetSRS.importFromWkt( crs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ).toLatin1().data() ); +#else oTargetSRS.importFromProj4( crs.toProj().toLatin1().data() ); +#endif char *wkt = nullptr; OGRErr err = oTargetSRS.exportToWkt( &wkt );