Skip to content
Permalink
Browse files

set mRectEngine on filterType FilterFid as well and check the mRectEn…

…ginge in case of ExactIntersect and FilterFid to avoid crash
  • Loading branch information
signedav committed Feb 15, 2021
1 parent e9623a4 commit 2942bc3bf80d4691e0df6fbc69039e43043918d1
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/providers/virtual/qgsvirtuallayerfeatureiterator.cpp
@@ -118,8 +118,8 @@ QgsVirtualLayerFeatureIterator::QgsVirtualLayerFeatureIterator( QgsVirtualLayerF
else // never return a feature if the id is negative
offset = QStringLiteral( " LIMIT 0" );
}
else if ( !mFilterRect.isNull() &&
mRequest.flags() & QgsFeatureRequest::ExactIntersect )
if ( !mFilterRect.isNull() &&
mRequest.flags() & QgsFeatureRequest::ExactIntersect )
{
// if an exact intersection is requested, prepare the geometry to intersect
QgsGeometry rectGeom = QgsGeometry::fromRect( mFilterRect );
@@ -327,7 +327,7 @@ bool QgsVirtualLayerFeatureIterator::fetchFeature( QgsFeature &feature )

// if the FilterRect has not been applied on the query
// apply it here by skipping features until they intersect
if ( mSource->mDefinition.uid().isNull() && mRequest.filterType() != QgsFeatureRequest::FilterFid && feature.hasGeometry() && mSource->mDefinition.hasDefinedGeometry() && !mFilterRect.isNull() )
if ( mSource->mDefinition.uid().isNull() && feature.hasGeometry() && mSource->mDefinition.hasDefinedGeometry() && !mFilterRect.isNull() )
{
if ( mRequest.flags() & QgsFeatureRequest::ExactIntersect )
{

0 comments on commit 2942bc3

Please sign in to comment.