Skip to content
Permalink
Browse files
wfs feature iterator: support ExactIntersect (fixes #8310)
  • Loading branch information
jef-n committed Jul 20, 2013
1 parent 745fcbf commit 401b6374ba7932e8b69f990034c37e8e5b4795b7
Showing with 17 additions and 4 deletions.
  1. +17 −4 src/providers/wfs/qgswfsfeatureiterator.cpp
@@ -16,6 +16,7 @@
#include "qgsspatialindex.h"
#include "qgswfsprovider.h"
#include "qgsmessagelog.h"
#include "qgsgeometry.h"

QgsWFSFeatureIterator::QgsWFSFeatureIterator( QgsWFSProvider* provider, const QgsFeatureRequest& request )
: QgsAbstractFeatureIterator( request )
@@ -67,12 +68,24 @@ bool QgsWFSFeatureIterator::nextFeature( QgsFeature& f )
return false;
}

QMap<QgsFeatureId, QgsFeature* >::iterator it = mProvider->mFeatures.find( *mFeatureIterator );
if ( it == mProvider->mFeatures.end() )
QgsFeature *fet = 0;

for ( ;; )
{
return false;
QMap<QgsFeatureId, QgsFeature* >::iterator it = mProvider->mFeatures.find( *mFeatureIterator );
if ( it == mProvider->mFeatures.end() )
return false;

fet = it.value();
if (( mRequest.flags() & QgsFeatureRequest::ExactIntersect ) == 0 )
break;

if ( fet->geometry() && fet->geometry()->intersects( mRequest.filterRect() ) )
break;

++mFeatureIterator;
}
QgsFeature* fet = it.value();


mProvider->copyFeature( fet, f, !( mRequest.flags() & QgsFeatureRequest::NoGeometry ) );
++mFeatureIterator;

0 comments on commit 401b637

Please sign in to comment.