aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-05-16 13:16:27 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-05-16 13:16:27 +0200
commite3bbef82833589c2286c2dde6c8b8d05a91698e0 (patch)
tree23dda03254d3d178a5286e67d95011577c759095 /src
parentfe3ffe8d5f6d7db7179032b10e6f5d3b37370bfd (diff)
downloadPROJ-e3bbef82833589c2286c2dde6c8b8d05a91698e0.tar.gz
PROJ-e3bbef82833589c2286c2dde6c8b8d05a91698e0.zip
createOperations(): when converting CompoundCRS<-->Geographic3DCrs, do not use discard change of ellipsoidal height if a Helmert transformation is involved (fixes #2225)
Diffstat (limited to 'src')
-rw-r--r--src/iso19111/coordinateoperation.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp
index 4ef99022..0285b89f 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -14797,10 +14797,16 @@ void CoordinateOperationFactory::Private::createOperationsCompoundToGeog(
if (!componentsSrc[0]->isEquivalentTo(
target2D.get(),
util::IComparable::Criterion::EQUIVALENT)) {
- interpToTargetOps = createOperations(
- NN_NO_CHECK(interpolationGeogCRS),
- targetCRS->demoteTo2D(std::string(), dbContext),
- context);
+ // We do the transformation from the
+ // interpolationCRS
+ // to the target one in 3D (see #2225)
+ // But we don't do that between sourceCRS and
+ // interpolationCRS, as this would mess with an
+ // orthometric elevation.
+ auto interp3D = interpolationGeogCRS->promoteTo3D(
+ std::string(), dbContext);
+ interpToTargetOps =
+ createOperations(interp3D, targetCRS, context);
}
};