Skip to content
Permalink
Browse files

[ogr] Don't try to calculate CRS for geometryless layers

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 7a2f148add1fbcb1ec0610e33aada94c60cd6413
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/providers/ogr/qgsogrprovider.cpp
@@ -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 )
@@ -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;

0 comments on commit 7a2f148

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