diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-05-16 19:51:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-16 19:51:48 +0200 |
| commit | cc1aca389c61eed789b90d57de3f7a52424e1ef2 (patch) | |
| tree | aba5dc6bca2c9ce4b36ada1efa1db9ca4207de65 /src/iso19111/operation/transformation.cpp | |
| parent | 5da981bcb9461fe25a2f742890c92b24161c3c37 (diff) | |
| parent | 752696eb8ac0ecb9ff96432ec5849625ed452f74 (diff) | |
| download | PROJ-cc1aca389c61eed789b90d57de3f7a52424e1ef2.tar.gz PROJ-cc1aca389c61eed789b90d57de3f7a52424e1ef2.zip | |
Merge pull request #2722 from rouault/epsg_10_022
Database: update to EPSG v10.022
Diffstat (limited to 'src/iso19111/operation/transformation.cpp')
| -rw-r--r-- | src/iso19111/operation/transformation.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/iso19111/operation/transformation.cpp b/src/iso19111/operation/transformation.cpp index 6126d325..273b636f 100644 --- a/src/iso19111/operation/transformation.cpp +++ b/src/iso19111/operation/transformation.cpp @@ -2007,6 +2007,7 @@ isGeographic3DToGravityRelatedHeight(const OperationMethodNNPtr &method, "1098", // Geog3D to Geog2D+GravityRelatedHeight (SA 2010) "1100", // Geog3D to Geog2D+GravityRelatedHeight (PL txt) "1103", // Geog3D to Geog2D+GravityRelatedHeight (EGM) + "1105", // Geog3D to Geog2D+GravityRelatedHeight (ITAL2005) "9661", // Geographic3D to GravityRelatedHeight (EGM) "9662", // Geographic3D to GravityRelatedHeight (Ausgeoid98) "9663", // Geographic3D to GravityRelatedHeight (OSGM-GB) @@ -2932,15 +2933,28 @@ void Transformation::_exportToPROJString( if (methodEPSGCode == EPSG_CODE_METHOD_VERTICAL_OFFSET) { - auto sourceCRSVert = - dynamic_cast<const crs::VerticalCRS *>(sourceCRS().get()); + const crs::CRS *srcCRS = sourceCRS().get(); + const crs::CRS *tgtCRS = targetCRS().get(); + + const auto sourceCRSCompound = + dynamic_cast<const crs::CompoundCRS *>(srcCRS); + const auto targetCRSCompound = + dynamic_cast<const crs::CompoundCRS *>(tgtCRS); + if (sourceCRSCompound && targetCRSCompound && + sourceCRSCompound->componentReferenceSystems()[0]->_isEquivalentTo( + targetCRSCompound->componentReferenceSystems()[0].get(), + util::IComparable::Criterion::EQUIVALENT)) { + srcCRS = sourceCRSCompound->componentReferenceSystems()[1].get(); + tgtCRS = targetCRSCompound->componentReferenceSystems()[1].get(); + } + + auto sourceCRSVert = dynamic_cast<const crs::VerticalCRS *>(srcCRS); if (!sourceCRSVert) { throw io::FormattingException( "Can apply Vertical offset only to VerticalCRS"); } - auto targetCRSVert = - dynamic_cast<const crs::VerticalCRS *>(targetCRS().get()); + auto targetCRSVert = dynamic_cast<const crs::VerticalCRS *>(tgtCRS); if (!targetCRSVert) { throw io::FormattingException( "Can apply Vertical offset only to VerticalCRS"); |
