Skip to content

Commit

Permalink
wfs feature iterator: support ExactIntersect (fixes #8310)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 20, 2013
1 parent 745fcbf commit 401b637
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/providers/wfs/qgswfsfeatureiterator.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 401b637

Please sign in to comment.