Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Use correct project transform context in transform expression function
- Loading branch information
Showing
with
5 additions
and
4 deletions.
-
+5
−4
src/core/expression/qgsexpressionfunction.cpp
|
@@ -4096,7 +4096,7 @@ static QVariant fcnGetGeometry( const QVariantList &values, const QgsExpressionC |
|
|
return QVariant(); |
|
|
} |
|
|
|
|
|
static QVariant fcnTransformGeometry( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent, const QgsExpressionNodeFunction * ) |
|
|
static QVariant fcnTransformGeometry( const QVariantList &values, const QgsExpressionContext *context, QgsExpression *parent, const QgsExpressionNodeFunction * ) |
|
|
{ |
|
|
QgsGeometry fGeom = QgsExpressionUtils::getGeometry( values.at( 0 ), parent ); |
|
|
QString sAuthId = QgsExpressionUtils::getStringValue( values.at( 1 ), parent ); |
|
@@ -4109,9 +4109,10 @@ static QVariant fcnTransformGeometry( const QVariantList &values, const QgsExpre |
|
|
if ( ! d.isValid() ) |
|
|
return QVariant::fromValue( fGeom ); |
|
|
|
|
|
Q_NOWARN_DEPRECATED_PUSH |
|
|
QgsCoordinateTransform t( s, d ); |
|
|
Q_NOWARN_DEPRECATED_POP |
|
|
QgsCoordinateTransformContext tContext; |
|
|
if ( context ) |
|
|
tContext = context->variable( QStringLiteral( "_project_transform_context" ) ).value<QgsCoordinateTransformContext>(); |
|
|
QgsCoordinateTransform t( s, d, tContext ); |
|
|
try |
|
|
{ |
|
|
if ( fGeom.transform( t ) == 0 ) |
|
|