Skip to content

Commit

Permalink
avoid OSRFixup with GDAL >= 2.5 (fixes #21902)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9a8c0d2)
  • Loading branch information
jef-n committed Apr 23, 2019
1 parent adb646f commit 0f315e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -637,8 +637,10 @@ bool QgsCoordinateReferenceSystem::createFromWkt( const QString &wkt )
{
CPLFree( proj4src );

#if GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(2,5,0)
// try fixed up version
OSRFixup( d->mCRS );
#endif

OSRExportToProj4( d->mCRS, &proj4src );

Expand Down Expand Up @@ -1175,9 +1177,11 @@ void QgsCoordinateReferenceSystem::setMapUnits()

char *unitName = nullptr;

#if GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(2,5,0)
// Of interest to us is that this call adds in a unit parameter if
// one doesn't already exist.
OSRFixup( d->mCRS );
#endif

if ( OSRIsProjected( d->mCRS ) )
{
Expand Down

0 comments on commit 0f315e4

Please sign in to comment.