Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ogr provider: improve detection of CRS
git-svn-id: http://svn.osgeo.org/qgis/trunk@15502 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 15, 2011
1 parent 57a0ddd commit 393e206
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -1841,12 +1841,22 @@ QgsCoordinateReferenceSystem QgsOgrProvider::crs()
{
QgsDebugMsg( "no spatial reference found" );
}
else if ( OSRAutoIdentifyEPSG( mySpatialRefSys ) == OGRERR_NONE )
{
QString authid = QString( "%1:%2" )
.arg( OSRGetAuthorityName( mySpatialRefSys, NULL ) )
.arg( OSRGetAuthorityCode( mySpatialRefSys, NULL ) );
QgsDebugMsg( "authid recognized as " + authid );
srs.createFromOgcWmsCrs( authid );
}
else
{
// get the proj4 text
char *ppszProj4;
OSRExportToProj4( mySpatialRefSys, &ppszProj4 );
QgsDebugMsg( ppszProj4 );
char *pszProj4;
OSRExportToProj4( mySpatialRefSys, &pszProj4 );
QgsDebugMsg( pszProj4 );
OGRFree( pszProj4 );

char *pszWkt = NULL;
OSRExportToWkt( mySpatialRefSys, &pszWkt );
QString myWktString = QString( pszWkt );
Expand Down

0 comments on commit 393e206

Please sign in to comment.