mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
ogr provider: improve detection of CRS
git-svn-id: http://svn.osgeo.org/qgis/trunk@15502 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
57a0ddde78
commit
393e206e2d
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user