Skip to content

Commit e464c76

Browse files
authoredSep 5, 2017
Merge pull request #5110 from nyalldawson/ogr_crs
[ogr] Don't try to calculate CRS for geometryless layers
2 parents a11e0c6 + 7a2f148 commit e464c76

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2920,7 +2920,7 @@ QGISEXTERN QList< QgsDataItemProvider * > *dataItemProviders()
29202920
QgsCoordinateReferenceSystem QgsOgrProvider::crs() const
29212921
{
29222922
QgsCoordinateReferenceSystem srs;
2923-
if ( !mValid )
2923+
if ( !mValid || ( mOGRGeomType == wkbNone ) )
29242924
return srs;
29252925

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

29592959
char *pszWkt = nullptr;

0 commit comments

Comments
 (0)