Skip to content

Commit

Permalink
Significantly improve OGR fetching speed - set ignored field only on …
Browse files Browse the repository at this point in the history
…select()

Beware: featureAtId() may interfere, this should be checked.
  • Loading branch information
wonder-sk committed Nov 7, 2011
1 parent 1d7d1c6 commit 625ff11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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() )
{
Expand Down

0 comments on commit 625ff11

Please sign in to comment.