aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-03-30 10:32:38 +0200
committerGitHub <noreply@github.com>2020-03-30 10:32:38 +0200
commit48db80eb7aaabaf4828193289bcfe72dd4a547ad (patch)
treecbf9098a8c88d75b6316f241a3c16afe5bfb92ea /src
parent7962bd46c5824a0ae414346ead49c68f7b3e5c1f (diff)
parent3fbb904c58c075b4f30cb895ce3e9eec57dc0622 (diff)
downloadPROJ-48db80eb7aaabaf4828193289bcfe72dd4a547ad.tar.gz
PROJ-48db80eb7aaabaf4828193289bcfe72dd4a547ad.zip
Merge pull request #2111 from PROJ-BOT/backport-2109-to-7.0
[Backport 7.0] 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 83c0516e..dd794fe4 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -8929,6 +8929,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);
@@ -8957,6 +8967,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);