Skip to content
Permalink
Browse files

Merge pull request #5110 from nyalldawson/ogr_crs

[ogr] Don't try to calculate CRS for geometryless layers
  • Loading branch information
nyalldawson committed Sep 5, 2017
2 parents a11e0c6 + 7a2f148 commit e464c76b64b23e3f971c8d3d712b020393695b25
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/providers/ogr/qgsogrprovider.cpp
@@ -2920,7 +2920,7 @@ QGISEXTERN QList< QgsDataItemProvider * > *dataItemProviders()
QgsCoordinateReferenceSystem QgsOgrProvider::crs() const
{
QgsCoordinateReferenceSystem srs;
if ( !mValid )
if ( !mValid || ( mOGRGeomType == wkbNone ) )
return srs;

if ( ogrDriver )
@@ -2953,7 +2953,7 @@ QgsCoordinateReferenceSystem QgsOgrProvider::crs() const
// get the proj4 text
char *pszProj4 = nullptr;
OSRExportToProj4( mySpatialRefSys, &pszProj4 );
QgsDebugMsg( pszProj4 );
QgsDebugMsgLevel( pszProj4, 4 );
CPLFree( pszProj4 );

char *pszWkt = nullptr;

0 comments on commit e464c76

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