Skip to content
Permalink
Browse files

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
jef committed Mar 15, 2011
1 parent 57a0ddd commit 393e206e2d19ddd40bb12d77065462982594bd0e
Showing with 13 additions and 3 deletions.
  1. +13 −3 src/providers/ogr/qgsogrprovider.cpp
@@ -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 );

0 comments on commit 393e206

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