Skip to content

Commit

Permalink
[afs] Use faster bounding box checks where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 20, 2018
1 parent 3ffbd84 commit 56b1ede
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/providers/arcgisrest/qgsafsfeatureiterator.cpp
Expand Up @@ -182,8 +182,26 @@ bool QgsAfsFeatureIterator::fetchFeature( QgsFeature &f )
++mFeatureIterator;
}

if ( !mFilterRect.isNull() && ( !f.hasGeometry() || !f.geometry().intersects( mFilterRect ) ) )
success = false;
if ( !mFilterRect.isNull() )
{
if ( !f.hasGeometry() )
success = false;
else
{
if ( mRequest.flags() & QgsFeatureRequest::ExactIntersect )
{
// exact intersection check requested
if ( !f.geometry().intersects( mFilterRect ) )
success = false;
}
else
{
// bounding box intersect check only
if ( !f.geometry().boundingBoxIntersects( mFilterRect ) )
success = false;
}
}
}

if ( !success )
continue;
Expand Down

0 comments on commit 56b1ede

Please sign in to comment.