Skip to content

Commit

Permalink
Add filterString to cacheBase key for overlay_* functions
Browse files Browse the repository at this point in the history
to avoid using cached target layer and cached spatial index if the filter string dynamically changes
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Nov 7, 2021
1 parent 45e7993 commit 4d762be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -5821,7 +5821,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
Expand Down

0 comments on commit 4d762be

Please sign in to comment.