Skip to content
Permalink
Browse files

ogr provider fix: apparently we need to fetch the geometry to make th…

…e spatial filter stick.
  • Loading branch information
jef-n committed Jul 18, 2011
1 parent 30708cb commit 40cabbdd4881ade35761975ae247cb7426306db0
Showing with 6 additions and 1 deletion.
  1. +3 −1 src/providers/ogr/qgsogrprovider.cpp
  2. +3 −0 src/providers/ogr/qgsogrprovider.h
@@ -518,7 +518,8 @@ bool QgsOgrProvider::nextFeature( QgsFeature& feature )
OGRFeatureH fet;
QgsRectangle selectionRect;

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

while (( fet = OGR_L_GetNextFeature( ogrLayer ) ) )
{
@@ -616,6 +617,7 @@ void QgsOgrProvider::select( QgsAttributeList fetchAttributes, QgsRectangle rect
mUseIntersect = useIntersect;
mAttributesToFetch = fetchAttributes;
mFetchGeom = fetchGeometry;
mFetchRect = rect;

// spatial query to select features
if ( rect.isEmpty() )
@@ -276,6 +276,9 @@ class QgsOgrProvider : public QgsVectorDataProvider
//! layer index
int mLayerIndex;

//! current spatial filter
QgsRectangle mFetchRect;

//! String used to define a subset of the layer
QString mSubsetString;

0 comments on commit 40cabbd

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