aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2020-03-29 22:37:47 +0000
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2020-03-29 22:37:47 +0000
commit2b91a507297a7e13b51a55d0f1ef7b3ec6ca6a60 (patch)
treedcf209e049cb0fc1be4a9fd71ce3ea38abcfc028 /src
parent9d596034ceecb63f290fc6d88bc0f68c1864b05a (diff)
downloadPROJ-2b91a507297a7e13b51a55d0f1ef7b3ec6ca6a60.tar.gz
PROJ-2b91a507297a7e13b51a55d0f1ef7b3ec6ca6a60.zip
Fix working of Helmert transform between the horizontal part of 2 compoundCRS (fixes #2108)
Diffstat (limited to 'src')
-rw-r--r--src/iso19111/coordinateoperation.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp
index 91801100..1b35e35a 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -8824,6 +8824,16 @@ static void setupPROJGeodeticSourceCRS(io::PROJStringFormatter *formatter,
const crs::CRSNNPtr &crs, bool addPushV3,
const char *trfrm_name) {
auto sourceCRSGeog = dynamic_cast<const crs::GeographicCRS *>(crs.get());
+ if (!sourceCRSGeog) {
+ auto compoundCRS = dynamic_cast<const crs::CompoundCRS *>(crs.get());
+ if (compoundCRS) {
+ const auto &components = compoundCRS->componentReferenceSystems();
+ if (!components.empty()) {
+ sourceCRSGeog = dynamic_cast<const crs::GeographicCRS *>(
+ components[0].get());
+ }
+ }
+ }
if (sourceCRSGeog) {
formatter->startInversion();
sourceCRSGeog->_exportToPROJString(formatter);
@@ -8852,6 +8862,16 @@ static void setupPROJGeodeticTargetCRS(io::PROJStringFormatter *formatter,
const crs::CRSNNPtr &crs, bool addPopV3,
const char *trfrm_name) {
auto targetCRSGeog = dynamic_cast<const crs::GeographicCRS *>(crs.get());
+ if (!targetCRSGeog) {
+ auto compoundCRS = dynamic_cast<const crs::CompoundCRS *>(crs.get());
+ if (compoundCRS) {
+ const auto &components = compoundCRS->componentReferenceSystems();
+ if (!components.empty()) {
+ targetCRSGeog = dynamic_cast<const crs::GeographicCRS *>(
+ components[0].get());
+ }
+ }
+ }
if (targetCRSGeog) {
formatter->addStep("cart");
formatter->setCurrentStepInverted(true);