aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2020-03-29 22:37:53 +0000
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2020-03-29 22:37:53 +0000
commit3fbb904c58c075b4f30cb895ce3e9eec57dc0622 (patch)
treecbf9098a8c88d75b6316f241a3c16afe5bfb92ea /src
parent7962bd46c5824a0ae414346ead49c68f7b3e5c1f (diff)
downloadPROJ-3fbb904c58c075b4f30cb895ce3e9eec57dc0622.tar.gz
PROJ-3fbb904c58c075b4f30cb895ce3e9eec57dc0622.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 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);