Skip to content
Permalink
Browse files
For EPSG initialize GDAL CRS from authid instead of proj.4 string
  • Loading branch information
jef-n authored and mach0 committed Nov 13, 2011
1 parent b79c4d3 commit 49ebe67
Showing 1 changed file with 11 additions and 2 deletions.
@@ -263,9 +263,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 49ebe67

Please sign in to comment.