Skip to content

Commit

Permalink
Merge pull request #5110 from nyalldawson/ogr_crs
Browse files Browse the repository at this point in the history
[ogr] Don't try to calculate CRS for geometryless layers
  • Loading branch information
nyalldawson authored Sep 5, 2017
2 parents a11e0c6 + 7a2f148 commit e464c76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2920,7 +2920,7 @@ QGISEXTERN QList< QgsDataItemProvider * > *dataItemProviders()
QgsCoordinateReferenceSystem QgsOgrProvider::crs() const
{
QgsCoordinateReferenceSystem srs;
if ( !mValid )
if ( !mValid || ( mOGRGeomType == wkbNone ) )
return srs;

if ( ogrDriver )
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e464c76

Please sign in to comment.