aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-05-16 12:41:07 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-05-16 12:41:07 +0200
commit752696eb8ac0ecb9ff96432ec5849625ed452f74 (patch)
treebe02df416cf02f5fcbda0bdba31444b1cd0d7035 /src
parent68a11b77249788fb8090e725792a5f62b4c5068b (diff)
downloadPROJ-752696eb8ac0ecb9ff96432ec5849625ed452f74.tar.gz
PROJ-752696eb8ac0ecb9ff96432ec5849625ed452f74.zip
Database: update to EPSG v10.022
Diffstat (limited to 'src')
-rw-r--r--src/iso19111/operation/concatenatedoperation.cpp28
-rw-r--r--src/iso19111/operation/transformation.cpp22
2 files changed, 46 insertions, 4 deletions
diff --git a/src/iso19111/operation/concatenatedoperation.cpp b/src/iso19111/operation/concatenatedoperation.cpp
index 20bbce6f..fda341dd 100644
--- a/src/iso19111/operation/concatenatedoperation.cpp
+++ b/src/iso19111/operation/concatenatedoperation.cpp
@@ -245,6 +245,34 @@ void ConcatenatedOperation::fixStepsDirection(
return false;
};
+ // Special case for EPSG:9731 "ETRS89 to ETRS89 + Catania 1965 height (1)"
+ // which chains "ETRS89 to ETRS89 + Genoa 1942 height (1)" and
+ // "Genoa 1942 height to Catania 1965 height (1)"
+ if (operationsInOut.size() == 2 && isGeographic(concatOpSourceCRS.get())) {
+ const auto compoundTarget =
+ dynamic_cast<const crs::CompoundCRS *>(concatOpTargetCRS.get());
+ const auto compoundTargetOp0 = dynamic_cast<const crs::CompoundCRS *>(
+ operationsInOut[0]->targetCRS().get());
+ if (compoundTarget && compoundTargetOp0 &&
+ operationsInOut[0]->sourceCRS() &&
+ operationsInOut[1]->sourceCRS() &&
+ operationsInOut[1]->targetCRS() &&
+ concatOpSourceCRS->nameStr() ==
+ compoundTarget->componentReferenceSystems()[0]->nameStr() &&
+ concatOpSourceCRS->nameStr() ==
+ operationsInOut[0]->sourceCRS()->nameStr() &&
+ concatOpSourceCRS->nameStr() ==
+ compoundTargetOp0->componentReferenceSystems()[0]->nameStr() &&
+ compoundTargetOp0->componentReferenceSystems()[1]->nameStr() ==
+ operationsInOut[1]->sourceCRS()->nameStr() &&
+ operationsInOut[1]->targetCRS()->nameStr() ==
+ compoundTarget->componentReferenceSystems()[1]->nameStr()) {
+ operationsInOut[1]->setCRSs(
+ NN_NO_CHECK(operationsInOut[0]->targetCRS()), concatOpTargetCRS,
+ nullptr);
+ }
+ }
+
for (size_t i = 0; i < operationsInOut.size(); ++i) {
auto &op = operationsInOut[i];
auto l_sourceCRS = op->sourceCRS();
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");