From c8d25f6ceff4450687c5ad29d09e3686dd3f59d4 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 19 Nov 2024 08:44:41 +1100 Subject: [PATCH] Show actual original coordinate in QgsCsException message We were incorrectly showing the "transformed" coordinate result in the exception message, which usually ended up inf, inf after the transform fails. This lead to a useless 'forward transform of (inf, inf)' message in the exception, which was misleading as it looks like we were trying to transform a (inf, inf) point. Now we get the (useful!) actual coordinate we were trying to transform in the exception message. --- src/core/proj/qgscoordinatetransform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/proj/qgscoordinatetransform.cpp b/src/core/proj/qgscoordinatetransform.cpp index c54fb6c92e49..1dfa5fcda7e4 100644 --- a/src/core/proj/qgscoordinatetransform.cpp +++ b/src/core/proj/qgscoordinatetransform.cpp @@ -892,7 +892,7 @@ void QgsCoordinateTransform::transformCoords( int numPoints, double *x, double * for ( int i = 0; i < numPoints; ++i ) { - points += QStringLiteral( "(%1, %2)\n" ).arg( x[i], 0, 'f' ).arg( y[i], 0, 'f' ); + points += QStringLiteral( "(%1, %2)\n" ).arg( xprev[i], 0, 'f' ).arg( yprev[i], 0, 'f' ); } const QString dir = ( direction == Qgis::TransformDirection::Forward ) ? QObject::tr( "forward transform" ) : QObject::tr( "inverse transform" );