Skip to content

Commit

Permalink
For EPSG initialize GDAL CRS from authid instead of proj.4 string
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 27, 2011
1 parent 306efcb commit 10de06c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -267,9 +267,18 @@ bool QgsCoordinateReferenceSystem::loadFromDb( QString db, QString expression, Q
{
mAuthId = QString( "USER:%1" ).arg( mSrsId );
}
else if ( mAuthId.startsWith( "EPSG:", Qt::CaseInsensitive ) )
{
OSRDestroySpatialReference( mCRS );
mCRS = OSRNewSpatialReference( NULL );
mIsValidFlag = OSRSetFromUserInput( mCRS, mAuthId.toLower().toAscii() ) == OGRERR_NONE;
setMapUnits();
}

setProj4String( toProj4 );
setMapUnits();
if ( !mIsValidFlag )
{
setProj4String( toProj4 );
}
}
else
{
Expand Down

0 comments on commit 10de06c

Please sign in to comment.