Skip to content

Commit

Permalink
Show actual original coordinate in QgsCsException message
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nyalldawson committed Nov 18, 2024
1 parent 25ec551 commit c8d25f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/proj/qgscoordinatetransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down

0 comments on commit c8d25f6

Please sign in to comment.