@@ -1064,10 +1064,17 @@ QString QgsCoordinateReferenceSystem::toProj4() const
1064
1064
1065
1065
if ( d->mProj4 .isEmpty () )
1066
1066
{
1067
+ #if PROJ_VERSION_MAJOR>=6
1068
+ if ( d->mPj )
1069
+ {
1070
+ d->mProj4 = QString ( proj_as_proj_string ( QgsProjContext::get (), d->mPj .get (), PJ_PROJ_4, nullptr ) );
1071
+ }
1072
+ #else
1067
1073
char *proj4src = nullptr ;
1068
1074
OSRExportToProj4 ( d->mCRS , &proj4src );
1069
1075
d->mProj4 = proj4src;
1070
1076
CPLFree ( proj4src );
1077
+ #endif
1071
1078
}
1072
1079
// Stray spaces at the end?
1073
1080
return d->mProj4 .trimmed ();
@@ -1231,8 +1238,6 @@ void QgsCoordinateReferenceSystem::setMapUnits()
1231
1238
return ;
1232
1239
}
1233
1240
1234
- char *unitName = nullptr ;
1235
-
1236
1241
#if GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(2,5,0)
1237
1242
// Of interest to us is that this call adds in a unit parameter if
1238
1243
// one doesn't already exist.
@@ -1287,6 +1292,8 @@ void QgsCoordinateReferenceSystem::setMapUnits()
1287
1292
}
1288
1293
1289
1294
#else
1295
+ char *unitName = nullptr ;
1296
+
1290
1297
if ( OSRIsProjected ( d->mCRS ) )
1291
1298
{
1292
1299
double toMeter = OSRGetLinearUnits ( d->mCRS , &unitName );
@@ -1966,7 +1973,7 @@ bool QgsCoordinateReferenceSystem::loadIds( QHash<int, QString> &wkts )
1966
1973
1967
1974
int QgsCoordinateReferenceSystem::syncDatabase ()
1968
1975
{
1969
- #if 1
1976
+ #if 0
1970
1977
setlocale( LC_ALL, "C" );
1971
1978
QString dbFilePath = QgsApplication::srsDatabaseFilePath();
1972
1979
syncDatumTransform( dbFilePath );
0 commit comments