aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-09-10 12:28:42 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-09-10 21:17:14 +0200
commiteedfc8908d0d630898d3375dc7b3d99deb4bc3ca (patch)
treeb677dfd1fddb6cf28b97b3607f05f02566775ac3
parented32f8e4f4c67502d22dbf2be2cefae15f39fe3a (diff)
downloadPROJ-eedfc8908d0d630898d3375dc7b3d99deb4bc3ca.tar.gz
PROJ-eedfc8908d0d630898d3375dc7b3d99deb4bc3ca.zip
proj_trans(): reset errno before attemptying a retry with a new coordinate operation (fixes #2352)
-rw-r--r--src/4D_api.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/4D_api.cpp b/src/4D_api.cpp
index 8f427412..75fa6d04 100644
--- a/src/4D_api.cpp
+++ b/src/4D_api.cpp
@@ -291,6 +291,15 @@ similarly, but prefers the 2D resp. 3D interfaces if available.
if( iBest < 0 ) {
break;
}
+ if( iRetry > 0 ) {
+ const int oldErrno = proj_errno_reset(P);
+ if (proj_log_level(P->ctx, PJ_LOG_TELL) >= PJ_LOG_DEBUG) {
+ pj_log(P->ctx, PJ_LOG_DEBUG, proj_errno_string(oldErrno));
+ }
+ pj_log(P->ctx, PJ_LOG_DEBUG,
+ "Did not result in valid result. "
+ "Attempting a retry with another operation.");
+ }
const auto& alt = P->alternativeCoordinateOperations[iBest];
if( P->iCurCoordOp != iBest ) {
@@ -309,9 +318,6 @@ similarly, but prefers the 2D resp. 3D interfaces if available.
if( res.xyzt.x != HUGE_VAL ) {
return res;
}
- pj_log(P->ctx, PJ_LOG_DEBUG,
- "Did not result in valid result. "
- "Attempting a retry with another operation.");
if( iRetry == N_MAX_RETRY ) {
break;
}