From b9d50247190e7b9ecd849ab260eb45edca3236cb Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 22 Nov 2018 21:32:51 +0100 Subject: Fix transformation between geographic CRS that differ by axis order and units --- src/io.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/io.cpp') diff --git a/src/io.cpp b/src/io.cpp index 8a58816f..c2ca484d 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -4708,6 +4708,24 @@ const std::string &PROJStringFormatter::toString() const { break; } + // axisswap order=2,1, unitconvert, axisswap order=2,1 -> can + // suppress axisswap + if (i + 1 < d->steps_.size() && prevStep.name == "axisswap" && + curStep.name == "unitconvert" && prevStepParamCount == 1 && + prevStep.paramValues[0].equals("order", "2,1")) { + auto iterNext = iterCur; + ++iterNext; + auto &nextStep = *iterNext; + if (nextStep.name == "axisswap" && + nextStep.paramValues.size() == 1 && + nextStep.paramValues[0].equals("order", "2,1")) { + d->steps_.erase(iterPrev); + d->steps_.erase(iterNext); + changeDone = true; + break; + } + } + // for practical purposes WGS84 and GRS80 ellipsoids are // equivalents (cartesian transform between both lead to differences // of the order of 1e-14 deg..). -- cgit v1.2.3