Skip to content

Commit

Permalink
different crs reprojection code revision
Browse files Browse the repository at this point in the history
  • Loading branch information
enricofer authored and m-kuhn committed Jul 3, 2020
1 parent d5f8adb commit 6bbcb3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -5696,9 +5696,9 @@ static QVariant executeGeomOverlay( const QVariantList &values, const QgsExpress
request.setFilterExpression( filterString ); //filter cached features
}

if (targetLayer->crs().authid() != sourceLayer->crs().authid())
if ( targetLayer->crs() != sourceLayer->crs() )
{
QgsCoordinateTransformContext TransformContext;
QgsCoordinateTransformContext TransformContext = context->variable( QStringLiteral( "_project_transform_context" ) ).value<QgsCoordinateTransformContext>();
request.setDestinationCrs(sourceLayer->crs(), TransformContext); //if crs are not the same, cached target will be reprojected to source crs
}

Expand Down Expand Up @@ -5790,7 +5790,7 @@ static QVariant indexedFilteredOverlay( QgsExpression &subExp, QgsExpressionCont
QVariantList results;
for ( QgsFeatureId id : targetFeatureIds )
{
if (!currentFeatId.isNull() && currentFeatId.toLongLong() == id)
if ( !currentFeatId.isNull() && currentFeatId.toLongLong() == id )
{
continue; //if sourceLayer and targetLayer are the same, current feature have to be excluded from spatial check
}
Expand Down

0 comments on commit 6bbcb3d

Please sign in to comment.