aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-03-29 23:11:20 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-03-30 00:37:17 +0200
commit64946ab103d66508bf56bf80417bb5d69876bd25 (patch)
tree600c12b88b003ae27d06a306222fc6a42a59e727 /src
parentb84c9d0cb61f3bd561da6092e15e294ae7e410e0 (diff)
downloadPROJ-64946ab103d66508bf56bf80417bb5d69876bd25.tar.gz
PROJ-64946ab103d66508bf56bf80417bb5d69876bd25.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 33210d24..267e9450 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -8930,6 +8930,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);
@@ -8958,6 +8968,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);