Skip to content
Permalink
Browse files

[afs] Use faster bounding box checks where possible

  • Loading branch information
nyalldawson committed Feb 20, 2018
1 parent 3ffbd84 commit 56b1edecfaa9746cde0d8231cce6d5564d093223
Showing with 20 additions and 2 deletions.
  1. +20 −2 src/providers/arcgisrest/qgsafsfeatureiterator.cpp
@@ -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;

0 comments on commit 56b1ede

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