Skip to content
Permalink
Browse files

For EPSG initialize GDAL CRS from authid instead of proj.4 string

  • Loading branch information
jef-n committed Oct 27, 2011
1 parent 306efcb commit 10de06c8dc2c3b094a3ecc4b2a6591d0745c1d70
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/core/qgscoordinatereferencesystem.cpp
@@ -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
{

0 comments on commit 10de06c

Please sign in to comment.
You can’t perform that action at this time.