aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-03-23 19:26:56 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-03-23 19:26:56 +0100
commit9af705d630b0cd629daa0b8a28b82ba28752aa7d (patch)
tree3179389d2936df251764c92b941dd6421f748ace /src
parentb76acd354ca376194fb1fb682e5347dbf2e20f8d (diff)
downloadPROJ-9af705d630b0cd629daa0b8a28b82ba28752aa7d.tar.gz
PROJ-9af705d630b0cd629daa0b8a28b82ba28752aa7d.zip
proj_get_suggested_operation(): extra fix to behave similarly to proj_create_crs_to_crs_from_pj()
Diffstat (limited to 'src')
-rw-r--r--src/iso19111/c_api.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index ec6f1dc4..17fbd079 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -7662,11 +7662,15 @@ int proj_get_suggested_operation(PJ_CONTEXT *ctx, PJ_OBJ_LIST *operations,
return -1;
}
- int iExcluded[2] = {-1, -1};
- const auto &preparedOps = opList->getPreparedOperations(ctx);
- if (preparedOps.empty() && !opList->objects.empty()) {
+ // Special case:
+ // proj_create_crs_to_crs_from_pj() always use the unique operation
+ // if there's a single one
+ if (opList->objects.size() == 1) {
return 0;
}
+
+ int iExcluded[2] = {-1, -1};
+ const auto &preparedOps = opList->getPreparedOperations(ctx);
int idx = pj_get_suggested_operation(ctx, preparedOps, iExcluded, direction,
coord);
if (idx >= 0) {