diff --git a/src/analysis/processing/qgsalgorithmtransform.cpp b/src/analysis/processing/qgsalgorithmtransform.cpp index 5d82faae6822..58dae0bd0cbc 100644 --- a/src/analysis/processing/qgsalgorithmtransform.cpp +++ b/src/analysis/processing/qgsalgorithmtransform.cpp @@ -102,6 +102,8 @@ QgsFeatureList QgsTransformAlgorithm::processFeature( const QgsFeature &f, QgsPr if ( !mCoordOp.isEmpty() ) mTransformContext.addCoordinateOperation( sourceCrs(), mDestCrs, mCoordOp ); mTransform = QgsCoordinateTransform( sourceCrs(), mDestCrs, mTransformContext ); + + mTransform.disableFallbackOperationHandler( true ); } if ( feature.hasGeometry() ) @@ -117,6 +119,14 @@ QgsFeatureList QgsTransformAlgorithm::processFeature( const QgsFeature &f, QgsPr { feature.clearGeometry(); } + + if ( !mWarnedAboutFallbackTransform && mTransform.fallbackOperationOccurred() ) + { + feedback->reportError( QObject::tr( "An alternative, ballpark-only transform was used when transforming coordinates for one or more features. " + "(Possibly an incorrect choice of operation was made for transformations between these reference systems - check " + "that the selected operation is valid for the full extent of the input layer.)" ) ); + mWarnedAboutFallbackTransform = true; // only warn once to avoid flooding the log + } } catch ( QgsCsException & ) { diff --git a/src/analysis/processing/qgsalgorithmtransform.h b/src/analysis/processing/qgsalgorithmtransform.h index edfb65c32a26..3d477c73b768 100644 --- a/src/analysis/processing/qgsalgorithmtransform.h +++ b/src/analysis/processing/qgsalgorithmtransform.h @@ -59,6 +59,7 @@ class QgsTransformAlgorithm : public QgsProcessingFeatureBasedAlgorithm QgsCoordinateTransform mTransform; QgsCoordinateTransformContext mTransformContext; QString mCoordOp; + bool mWarnedAboutFallbackTransform = false; };