Skip to content

Commit

Permalink
[ogr] Don't try to calculate CRS for geometryless layers
Browse files Browse the repository at this point in the history
Slight speedup when loading attribute table containing
joins to a geometryless OGR table
  • Loading branch information
nyalldawson committed Sep 3, 2017
1 parent e30f704 commit 7a2f148
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -2913,10 +2913,8 @@ QGISEXTERN QList< QgsDataItemProvider * > *dataItemProviders()

QgsCoordinateReferenceSystem QgsOgrProvider::crs() const
{
QgsDebugMsg( "Entering." );

QgsCoordinateReferenceSystem srs;
if ( !mValid )
if ( !mValid || ( mOGRGeomType == wkbNone ) )
return srs;

if ( ogrDriver )
Expand Down Expand Up @@ -2949,7 +2947,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 7a2f148

Please sign in to comment.