aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/operation/coordinateoperationfactory.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-04-05 20:53:20 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-04-05 21:30:52 +0200
commit34e93f11392e6966ed5bbaced983dea444157419 (patch)
tree5be17896aa2506481f8e48a9a8968ee135456cab /src/iso19111/operation/coordinateoperationfactory.cpp
parent3ae02ac091440298808e6ea0ba76ae692ded06bb (diff)
downloadPROJ-34e93f11392e6966ed5bbaced983dea444157419.tar.gz
PROJ-34e93f11392e6966ed5bbaced983dea444157419.zip
createOperations(): make createBetweenGeodeticCRSWithDatumBasedIntermediates() reachable...
... and optimize its execution time by rewriting it completely. This code path was no longer triggered in tests since EPSG got a direct transformation for GDA94 to WGS 84 (G1762).
Diffstat (limited to 'src/iso19111/operation/coordinateoperationfactory.cpp')
-rw-r--r--src/iso19111/operation/coordinateoperationfactory.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/iso19111/operation/coordinateoperationfactory.cpp b/src/iso19111/operation/coordinateoperationfactory.cpp
index 8fb6d9b2..eb560cc9 100644
--- a/src/iso19111/operation/coordinateoperationfactory.cpp
+++ b/src/iso19111/operation/coordinateoperationfactory.cpp
@@ -3282,22 +3282,19 @@ bool CoordinateOperationFactory::Private::createOperationsFromDatabase(
res.insert(res.end(), resWithIntermediate.begin(),
resWithIntermediate.end());
doFilterAndCheckPerfectOp = !res.empty();
+ }
- } else if (!context.inCreateOperationsWithDatumPivotAntiRecursion &&
- !resFindDirectNonEmptyBeforeFiltering && geodSrc && geodDst &&
- !sameGeodeticDatum &&
- context.context->getIntermediateCRS().empty() &&
- context.context->getAllowUseIntermediateCRS() !=
- CoordinateOperationContext::IntermediateCRSUse::NEVER) {
-
- bool tryWithGeodeticDatumIntermediate = res.empty();
- if (tryWithGeodeticDatumIntermediate) {
- auto resWithIntermediate = findsOpsInRegistryWithIntermediate(
- sourceCRS, targetCRS, context, true);
- res.insert(res.end(), resWithIntermediate.begin(),
- resWithIntermediate.end());
- doFilterAndCheckPerfectOp = !res.empty();
- }
+ if (res.empty() && !context.inCreateOperationsWithDatumPivotAntiRecursion &&
+ !resFindDirectNonEmptyBeforeFiltering && geodSrc && geodDst &&
+ !sameGeodeticDatum && context.context->getIntermediateCRS().empty() &&
+ context.context->getAllowUseIntermediateCRS() !=
+ CoordinateOperationContext::IntermediateCRSUse::NEVER) {
+ // Currently triggered by "IG05/12 Intermediate CRS" to ITRF2014
+ auto resWithIntermediate = findsOpsInRegistryWithIntermediate(
+ sourceCRS, targetCRS, context, true);
+ res.insert(res.end(), resWithIntermediate.begin(),
+ resWithIntermediate.end());
+ doFilterAndCheckPerfectOp = !res.empty();
}
if (doFilterAndCheckPerfectOp) {