From 47410920e0426d0eccbdbc27ca9dfc494f68a084 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:45:10 -0400 Subject: [PATCH] Match 9.4.1 tag contents --- src/iso19111/io.cpp | 151 ------------------ .../operation/coordinateoperationfactory.cpp | 12 -- 2 files changed, 163 deletions(-) diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp index 734bb1b404..a65ce729f0 100644 --- a/src/iso19111/io.cpp +++ b/src/iso19111/io.cpp @@ -9054,157 +9054,6 @@ const std::string &PROJStringFormatter::toString() const { continue; } - // +step +proj=unitconvert +z_in=Z1 +z_out=Z2 - // +step +proj=unitconvert +xy_in=X1 +z_in=Z2 +xy_out=X2 +z_out=Z3 - // ==> +step +proj=unitconvert +xy_in=X1 +z_in=Z1 +xy_out=X2 - // +z_out=Z3 - if (prevStep.name == "unitconvert" && - curStep.name == "unitconvert" && !prevStep.inverted && - !curStep.inverted && prevStep.paramValues.size() == 2 && - curStep.paramValues.size() == 4 && - prevStep.paramValues[0].keyEquals("z_in") && - prevStep.paramValues[1].keyEquals("z_out") && - curStep.paramValues[0].keyEquals("xy_in") && - curStep.paramValues[1].keyEquals("z_in") && - curStep.paramValues[2].keyEquals("xy_out") && - curStep.paramValues[3].keyEquals("z_out") && - prevStep.paramValues[1].value == curStep.paramValues[1].value) { - auto xy_in = curStep.paramValues[0].value; - auto z_in = prevStep.paramValues[0].value; - auto xy_out = curStep.paramValues[2].value; - auto z_out = curStep.paramValues[3].value; - - iterCur->paramValues.clear(); - iterCur->paramValues.emplace_back( - Step::KeyValue("xy_in", xy_in)); - iterCur->paramValues.emplace_back(Step::KeyValue("z_in", z_in)); - iterCur->paramValues.emplace_back( - Step::KeyValue("xy_out", xy_out)); - iterCur->paramValues.emplace_back( - Step::KeyValue("z_out", z_out)); - - deletePrevIter(); - continue; - } - - // +step +proj=unitconvert +xy_in=X1 +z_in=Z1 +xy_out=X2 +z_out=Z2 - // +step +proj=unitconvert +xy_in=X2 +xy_out=X3 - // ==> +step +proj=unitconvert +xy_in=X1 +z_in=Z1 +xy_out=X3 - // +z_out=Z2 - if (prevStep.name == "unitconvert" && - curStep.name == "unitconvert" && !prevStep.inverted && - !curStep.inverted && prevStep.paramValues.size() == 4 && - curStep.paramValues.size() == 2 && - prevStep.paramValues[0].keyEquals("xy_in") && - prevStep.paramValues[1].keyEquals("z_in") && - prevStep.paramValues[2].keyEquals("xy_out") && - prevStep.paramValues[3].keyEquals("z_out") && - curStep.paramValues[0].keyEquals("xy_in") && - curStep.paramValues[1].keyEquals("xy_out") && - prevStep.paramValues[2].value == curStep.paramValues[0].value) { - auto xy_in = prevStep.paramValues[0].value; - auto z_in = prevStep.paramValues[1].value; - auto xy_out = curStep.paramValues[1].value; - auto z_out = prevStep.paramValues[3].value; - - iterCur->paramValues.clear(); - iterCur->paramValues.emplace_back( - Step::KeyValue("xy_in", xy_in)); - iterCur->paramValues.emplace_back(Step::KeyValue("z_in", z_in)); - iterCur->paramValues.emplace_back( - Step::KeyValue("xy_out", xy_out)); - iterCur->paramValues.emplace_back( - Step::KeyValue("z_out", z_out)); - - deletePrevIter(); - continue; - } - - // clang-format off - // A bit odd. Used to simplify geog3d_feet -> EPSG:6318+6360 - // of https://github.com/OSGeo/PROJ/issues/3938 - // where we get originally - // +step +proj=unitconvert +xy_in=deg +z_in=ft +xy_out=rad +z_out=us-ft - // +step +proj=unitconvert +xy_in=rad +z_in=m +xy_out=deg +z_out=m - // and want it simplified as: - // +step +proj=unitconvert +xy_in=deg +z_in=ft +xy_out=deg +z_out=us-ft - // - // More generally: - // +step +proj=unitconvert +xy_in=X1 +z_in=Z1 +xy_out=X2 +z_out=Z2 - // +step +proj=unitconvert +xy_in=X2 +z_in=Z3 +xy_out=X3 +z_out=Z3 - // ==> +step +proj=unitconvert +xy_in=X1 +z_in=Z1 +xy_out=X3 +z_out=Z2 - // clang-format on - if (prevStep.name == "unitconvert" && - curStep.name == "unitconvert" && !prevStep.inverted && - !curStep.inverted && prevStep.paramValues.size() == 4 && - curStep.paramValues.size() == 4 && - prevStep.paramValues[0].keyEquals("xy_in") && - prevStep.paramValues[1].keyEquals("z_in") && - prevStep.paramValues[2].keyEquals("xy_out") && - prevStep.paramValues[3].keyEquals("z_out") && - curStep.paramValues[0].keyEquals("xy_in") && - curStep.paramValues[1].keyEquals("z_in") && - curStep.paramValues[2].keyEquals("xy_out") && - curStep.paramValues[3].keyEquals("z_out") && - prevStep.paramValues[2].value == curStep.paramValues[0].value && - curStep.paramValues[1].value == curStep.paramValues[3].value) { - auto xy_in = prevStep.paramValues[0].value; - auto z_in = prevStep.paramValues[1].value; - auto xy_out = curStep.paramValues[2].value; - auto z_out = prevStep.paramValues[3].value; - - iterCur->paramValues.clear(); - iterCur->paramValues.emplace_back( - Step::KeyValue("xy_in", xy_in)); - iterCur->paramValues.emplace_back(Step::KeyValue("z_in", z_in)); - iterCur->paramValues.emplace_back( - Step::KeyValue("xy_out", xy_out)); - iterCur->paramValues.emplace_back( - Step::KeyValue("z_out", z_out)); - - deletePrevIter(); - continue; - } - - // clang-format off - // Variant of above - // +step +proj=unitconvert +xy_in=X1 +z_in=Z1 +xy_out=X2 +z_out=Z1 - // +step +proj=unitconvert +xy_in=X2 +z_in=Z2 +xy_out=X3 +z_out=Z3 - // ==> +step +proj=unitconvert +xy_in=X1 +z_in=Z2 +xy_out=X3 +z_out=Z3 - // clang-format on - if (prevStep.name == "unitconvert" && - curStep.name == "unitconvert" && !prevStep.inverted && - !curStep.inverted && prevStep.paramValues.size() == 4 && - curStep.paramValues.size() == 4 && - prevStep.paramValues[0].keyEquals("xy_in") && - prevStep.paramValues[1].keyEquals("z_in") && - prevStep.paramValues[2].keyEquals("xy_out") && - prevStep.paramValues[3].keyEquals("z_out") && - curStep.paramValues[0].keyEquals("xy_in") && - curStep.paramValues[1].keyEquals("z_in") && - curStep.paramValues[2].keyEquals("xy_out") && - curStep.paramValues[3].keyEquals("z_out") && - prevStep.paramValues[1].value == - prevStep.paramValues[3].value && - curStep.paramValues[0].value == prevStep.paramValues[2].value) { - auto xy_in = prevStep.paramValues[0].value; - auto z_in = curStep.paramValues[1].value; - auto xy_out = curStep.paramValues[2].value; - auto z_out = curStep.paramValues[3].value; - - iterCur->paramValues.clear(); - iterCur->paramValues.emplace_back( - Step::KeyValue("xy_in", xy_in)); - iterCur->paramValues.emplace_back(Step::KeyValue("z_in", z_in)); - iterCur->paramValues.emplace_back( - Step::KeyValue("xy_out", xy_out)); - iterCur->paramValues.emplace_back( - Step::KeyValue("z_out", z_out)); - - deletePrevIter(); - continue; - } - // unitconvert (1), axisswap order=2,1, unitconvert(2) ==> // axisswap order=2,1, unitconvert (1), unitconvert(2) which // will get further optimized by previous case diff --git a/src/iso19111/operation/coordinateoperationfactory.cpp b/src/iso19111/operation/coordinateoperationfactory.cpp index b5aa46ef22..da6dd3fcf6 100644 --- a/src/iso19111/operation/coordinateoperationfactory.cpp +++ b/src/iso19111/operation/coordinateoperationfactory.cpp @@ -5166,18 +5166,6 @@ getBallparkTransformationVertToVert(const crs::CRSNNPtr &sourceCRS, // --------------------------------------------------------------------------- -static std::string -getBallparkTransformationVertToVert(const crs::CRSNNPtr &sourceCRS, - const crs::CRSNNPtr &targetCRS) { - auto name = buildTransfName(sourceCRS->nameStr(), targetCRS->nameStr()); - name += " ("; - name += BALLPARK_VERTICAL_TRANSFORMATION; - name += ')'; - return name; -} - -// --------------------------------------------------------------------------- - void CoordinateOperationFactory::Private::createOperationsVertToVert( const crs::CRSNNPtr &sourceCRS, const crs::CRSNNPtr &targetCRS, Private::Context &context, const crs::VerticalCRS *vertSrc,