Skip to content

Commit

Permalink
Fix incorrectly ellipsoid acronym returned when creating a CRS from a…
Browse files Browse the repository at this point in the history
… custom non-standard proj string on proj 6+ builds

(cherry picked from commit 1c34ae9)
  • Loading branch information
nyalldawson committed Dec 20, 2019
1 parent 2c6f49c commit 8d43085
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -1396,14 +1396,7 @@ void QgsCoordinateReferenceSystem::setProjString( const QString &proj4String )
} }
else else
{ {
QgsProjUtils::proj_pj_unique_ptr ellipsoid( proj_get_ellipsoid( ctx, d->mPj.get() ) ); d->mEllipsoidAcronym.clear();
if ( ellipsoid )
{
const QString ellipsoidAuthName( proj_get_id_auth_name( ellipsoid.get(), 0 ) );
const QString ellipsoidAuthCode( proj_get_id_code( ellipsoid.get(), 0 ) );
d->mEllipsoidAcronym = QStringLiteral( "%1:%2" ).arg( ellipsoidAuthName, ellipsoidAuthCode );
}

d->mIsValid = true; d->mIsValid = true;
} }
#else #else
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgscoordinatereferencesystem.cpp
Expand Up @@ -439,7 +439,7 @@ void TestQgsCoordinateReferenceSystem::fromProj4EPSG20936()
QCOMPARE( crs.authid(), QStringLiteral( "EPSG:20936" ) ); QCOMPARE( crs.authid(), QStringLiteral( "EPSG:20936" ) );
#endif #endif


QCOMPARE( crs.ellipsoidAcronym(), QStringLiteral( "EPSG:7013" ) ); QCOMPARE( crs.ellipsoidAcronym(), QStringLiteral( "PARAMETER:6378249.14499999955296516:6356514.96639875322580338" ) );
#endif #endif
} }


Expand Down

0 comments on commit 8d43085

Please sign in to comment.