Skip to content
Permalink
Browse files

Significantly improve OGR fetching speed - set ignored field only on …

…select()

Beware: featureAtId() may interfere, this should be checked.
  • Loading branch information
wonder-sk committed Nov 7, 2011
1 parent 1d7d1c6 commit 625ff111e1fb6c723db93017bb7bd5bd2c13ccc0
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/providers/ogr/qgsogrprovider.cpp
@@ -626,9 +626,6 @@ bool QgsOgrProvider::nextFeature( QgsFeature& feature )
OGRFeatureH fet;
QgsRectangle selectionRect;

setRelevantFields( mFetchGeom || mUseIntersect || !mFetchRect.isEmpty(),
mAttributesToFetch );

while (( fet = OGR_L_GetNextFeature( ogrLayer ) ) )
{
// skip features without geometry
@@ -727,6 +724,9 @@ void QgsOgrProvider::select( QgsAttributeList fetchAttributes, QgsRectangle rect
mFetchGeom = fetchGeometry;
mFetchRect = rect;

setRelevantFields( mFetchGeom || mUseIntersect || !mFetchRect.isEmpty(),
mAttributesToFetch );

// spatial query to select features
if ( rect.isEmpty() )
{

0 comments on commit 625ff11

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