Skip to content

Commit 625ff11

Browse files
committedNov 7, 2011
Significantly improve OGR fetching speed - set ignored field only on select()
Beware: featureAtId() may interfere, this should be checked.
1 parent 1d7d1c6 commit 625ff11

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,6 @@ bool QgsOgrProvider::nextFeature( QgsFeature& feature )
626626
OGRFeatureH fet;
627627
QgsRectangle selectionRect;
628628

629-
setRelevantFields( mFetchGeom || mUseIntersect || !mFetchRect.isEmpty(),
630-
mAttributesToFetch );
631-
632629
while (( fet = OGR_L_GetNextFeature( ogrLayer ) ) )
633630
{
634631
// skip features without geometry
@@ -727,6 +724,9 @@ void QgsOgrProvider::select( QgsAttributeList fetchAttributes, QgsRectangle rect
727724
mFetchGeom = fetchGeometry;
728725
mFetchRect = rect;
729726

727+
setRelevantFields( mFetchGeom || mUseIntersect || !mFetchRect.isEmpty(),
728+
mAttributesToFetch );
729+
730730
// spatial query to select features
731731
if ( rect.isEmpty() )
732732
{

0 commit comments

Comments
 (0)
Please sign in to comment.