aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-11-28 15:31:36 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-11-28 15:31:36 +0100
commitb0983324c5ac3e2435a36a8aa5030c81f2ad779a (patch)
tree0ca06cba718e7753b6d7f3d94fa7b80d3c259177 /src
parentcfbf125b474dc5cfc7ce6aaafe866c4035aaffd2 (diff)
downloadPROJ-b0983324c5ac3e2435a36a8aa5030c81f2ad779a.tar.gz
PROJ-b0983324c5ac3e2435a36a8aa5030c81f2ad779a.zip
Attempt at fixing test failures due to 8a5740637760f837c9145c72ad8080927a3a4bf0 in the no-grid scenario
Diffstat (limited to 'src')
-rw-r--r--src/iso19111/coordinateoperation.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp
index 392810b1..e1430a85 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -12948,17 +12948,28 @@ bool CoordinateOperationFactory::Private::createOperationsFromDatabase(
}
bool foundInstantiableOp = false;
- if (!res.empty()) {
- for (const auto &op : res) {
- if (op->isPROJInstantiable(context.context->getAuthorityFactory()
- ->databaseContext())) {
- foundInstantiableOp = true;
- break;
- }
+ // FIXME: the limitation to .size() == 1 is just for the
+ // -s EPSG:4959+5759 -t "EPSG:4959+7839" case
+ // finding EPSG:7860 'NZVD2016 height to Auckland 1946
+ // height (1)', which uses the EPSG:1071 'Vertical Offset by Grid
+ // Interpolation (NZLVD)' method which is not currently implemented by PROJ
+ // (cannot deal with .csv files)
+ // Initially the test was written to iterate over for all operations of a
+ // non-empty res, but this causes failures in the test suite when no grids
+ // are installed at all. Ideally we should tweak the test suite to be
+ // robust to that, or skip some tests.
+ if (res.size() == 1) {
+ try {
+ res.front()->exportToPROJString(
+ io::PROJStringFormatter::create().get());
+ foundInstantiableOp = true;
+ } catch (const std::exception &) {
}
if (!foundInstantiableOp) {
resFindDirectNonEmptyBeforeFiltering = false;
}
+ } else if (res.size() > 1) {
+ foundInstantiableOp = true;
}
// NAD27 to NAD83 has tens of results already. No need to look