From a227423cda40ae791fb9fdf3dff22dfa6b01ad0e Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 5 Oct 2020 18:14:53 +0200 Subject: proj_crs_create_bound_crs_to_WGS84(): make it work on verticalCRS/compoundCRS such as EPSG:4326+5773 and EPSG:4326+3855 --- src/iso19111/coordinateoperation.cpp | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src/iso19111/coordinateoperation.cpp') diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index 6593d3e9..6fcf4d30 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -8701,15 +8701,6 @@ _getHeightToGeographic3DFilename(const Transformation *op, bool allowInverse) { // --------------------------------------------------------------------------- -//! @cond Doxygen_Suppress -const std::string &Transformation::getHeightToGeographic3DFilename() const { - - return _getHeightToGeographic3DFilename(this, false); -} -//! @endcond - -// --------------------------------------------------------------------------- - //! @cond Doxygen_Suppress static bool isGeographic3DToGravityRelatedHeight(const OperationMethodNNPtr &method, @@ -8764,6 +8755,27 @@ isGeographic3DToGravityRelatedHeight(const OperationMethodNNPtr &method, // --------------------------------------------------------------------------- +//! @cond Doxygen_Suppress +const std::string &Transformation::getHeightToGeographic3DFilename() const { + + const std::string &ret = _getHeightToGeographic3DFilename(this, false); + if (!ret.empty()) + return ret; + if (isGeographic3DToGravityRelatedHeight(method(), false)) { + const auto &fileParameter = + parameterValue(EPSG_NAME_PARAMETER_GEOID_CORRECTION_FILENAME, + EPSG_CODE_PARAMETER_GEOID_CORRECTION_FILENAME); + if (fileParameter && + fileParameter->type() == ParameterValue::Type::FILENAME) { + return fileParameter->valueFile(); + } + } + return nullString; +} +//! @endcond + +// --------------------------------------------------------------------------- + //! @cond Doxygen_Suppress static util::PropertyMap createSimilarPropertiesMethod(common::IdentifiedObjectNNPtr obj) { -- cgit v1.2.3