Skip to content
Permalink
Browse files
Add filterString to cacheBase key for overlay_* functions
to avoid using cached target layer and cached spatial index if the filter string dynamically changes
  • Loading branch information
agiudiceandrea authored and github-actions committed Oct 31, 2021
1 parent ff6a6c9 commit 5ec56d9baf51d6aa4989437e6b53b11fb1666392
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/expression/qgsexpressionfunction.cpp
@@ -5817,7 +5817,7 @@ static QVariant executeGeomOverlay( const QVariantList &values, const QgsExpress
intDomain.grow( bboxGrow ); //optional parameter to enlarge boundary context for touches and equals methods
}

const QString cacheBase { QStringLiteral( "%1:%2" ).arg( targetLayer->id(), subExpString ) };
const QString cacheBase { QStringLiteral( "%1:%2:%3" ).arg( targetLayer->id(), subExpString, filterString ) };

// Cache (a local spatial index) is always enabled for nearest function (as we need QgsSpatialIndex::nearestNeighbor)
// Otherwise, it can be toggled by the user

0 comments on commit 5ec56d9

Please sign in to comment.