Speed up QgsFeatureRequests::acceptFeature when only non-exact intersection tests are required

This commit is contained in:
Nyall Dawson 2019-08-22 15:12:06 +10:00
parent 570e85dd53
commit 9ae5ff5c52

View File

@ -273,7 +273,13 @@ bool QgsFeatureRequest::acceptFeature( const QgsFeature &feature )
{
if ( !mFilterRect.isNull() )
{
if ( !feature.hasGeometry() || !feature.geometry().intersects( mFilterRect ) )
if ( !feature.hasGeometry() ||
(
( mFlags & ExactIntersect && !feature.geometry().intersects( mFilterRect ) )
||
( !( mFlags & ExactIntersect ) && !feature.geometry().boundingBoxIntersects( mFilterRect ) )
)
)
return false;
}