aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/operation/concatenatedoperation.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-04-22 22:51:31 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-04-23 01:07:04 +0200
commitf6abb7d75c647013dd83a82361b96c202e615d90 (patch)
tree6743cf5b5feab06004e85ff55f654cd1671a6dc9 /src/iso19111/operation/concatenatedoperation.cpp
parentc6dba3fffb80fe6394f51aae0762f7e5db6d9edf (diff)
downloadPROJ-f6abb7d75c647013dd83a82361b96c202e615d90.tar.gz
PROJ-f6abb7d75c647013dd83a82361b96c202e615d90.zip
Database: update to EPSG v10.019
Non-trivial updates: - some vertical CRS are now encoded as DerivedVerticalCRS. e.g EPSG:8228 "NAVD88 height (ft)", with base EPSG:5703 "NAVD88 height". As we don't have support in our PROJ db model for DerivedVerticalCRS, modify the import script to 'resolve' the derivation up to the original datum. - Method EPSG:1069 'Change of Vertical Unit' is no longer used. It is replaced by a generic-purpose EPSG:1104 method that doesn't take any conversion factor. And generic conversions EPSG:7812 and EPSG:7813 are now used in concatenated operations, which require code changes as well.
Diffstat (limited to 'src/iso19111/operation/concatenatedoperation.cpp')
-rw-r--r--src/iso19111/operation/concatenatedoperation.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/iso19111/operation/concatenatedoperation.cpp b/src/iso19111/operation/concatenatedoperation.cpp
index a1c0dca8..ad2ab65b 100644
--- a/src/iso19111/operation/concatenatedoperation.cpp
+++ b/src/iso19111/operation/concatenatedoperation.cpp
@@ -48,6 +48,7 @@
#include "proj.h"
#include "proj_internal.h" // M_PI
// clang-format on
+#include "proj_constants.h"
#include "proj_json_streaming_writer.hpp"
@@ -341,6 +342,37 @@ void ConcatenatedOperation::fixStepsDirection(
if (l_sourceCRS && l_targetCRS) {
op->setCRSs(NN_NO_CHECK(l_sourceCRS), NN_NO_CHECK(l_targetCRS),
nullptr);
+ } else if (l_sourceCRS && l_targetCRS == nullptr &&
+ conv->method()->getEPSGCode() ==
+ EPSG_CODE_METHOD_HEIGHT_DEPTH_REVERSAL) {
+ // Needed for EPSG:7987 e.g.
+ auto vertCRS =
+ dynamic_cast<const crs::VerticalCRS *>(l_sourceCRS.get());
+ if (vertCRS && ends_with(l_sourceCRS->nameStr(), " height") &&
+ &vertCRS->coordinateSystem()->axisList()[0]->direction() ==
+ &cs::AxisDirection::UP) {
+ op->setCRSs(
+ NN_NO_CHECK(l_sourceCRS),
+ crs::VerticalCRS::create(
+ util::PropertyMap().set(
+ common::IdentifiedObject::NAME_KEY,
+ l_sourceCRS->nameStr().substr(
+ 0, l_sourceCRS->nameStr().size() -
+ strlen(" height")) +
+ " depth"),
+ vertCRS->datum(), vertCRS->datumEnsemble(),
+ cs::VerticalCS::create(
+ util::PropertyMap(),
+ cs::CoordinateSystemAxis::create(
+ util::PropertyMap().set(
+ common::IdentifiedObject::NAME_KEY,
+ "Gravity-related depth"),
+ "D", cs::AxisDirection::DOWN,
+ vertCRS->coordinateSystem()
+ ->axisList()[0]
+ ->unit()))),
+ nullptr);
+ }
}
} else if (!conv && l_sourceCRS && l_targetCRS) {