aboutsummaryrefslogtreecommitdiff
path: root/src/io.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-11-22 21:32:51 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-11-22 21:32:51 +0100
commitb9d50247190e7b9ecd849ab260eb45edca3236cb (patch)
tree1a82cbecf9a1d6e66b6f5f36a41cac6208bdb494 /src/io.cpp
parent85a4e9149152dd97463651496854f9ecbd720b84 (diff)
downloadPROJ-b9d50247190e7b9ecd849ab260eb45edca3236cb.tar.gz
PROJ-b9d50247190e7b9ecd849ab260eb45edca3236cb.zip
Fix transformation between geographic CRS that differ by axis order and units
Diffstat (limited to 'src/io.cpp')
-rw-r--r--src/io.cpp18
1 files changed, 18 insertions, 0 deletions
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..).