Skip to content

Commit

Permalink
Match 9.4.1 tag contents
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Jun 25, 2024
1 parent 27be1f0 commit 4741092
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 163 deletions.
151 changes: 0 additions & 151 deletions src/iso19111/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions src/iso19111/operation/coordinateoperationfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4741092

Please sign in to comment.