diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-12-13 16:23:01 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-12-13 16:30:48 +0100 |
| commit | 13625a0c3f5a8a1b3a6ac63b4f49234a3722f62c (patch) | |
| tree | af44cafeaff73b6843576222e2b8bafefb8425ae /src/coordinateoperation.cpp | |
| parent | 048cd320b4e63b9378cf6332c8bff11f03a6c39b (diff) | |
| download | PROJ-13625a0c3f5a8a1b3a6ac63b4f49234a3722f62c.tar.gz PROJ-13625a0c3f5a8a1b3a6ac63b4f49234a3722f62c.zip | |
Tune behaviour for LAEA vs LAEA Spherical or EQC vs EQC Spherical
Diffstat (limited to 'src/coordinateoperation.cpp')
| -rw-r--r-- | src/coordinateoperation.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/coordinateoperation.cpp b/src/coordinateoperation.cpp index a1f305bf..ac170bbf 100644 --- a/src/coordinateoperation.cpp +++ b/src/coordinateoperation.cpp @@ -1503,10 +1503,35 @@ bool SingleOperation::_isEquivalentTo(const util::IComparable *other, const int methodEPSGCode = d->method_->getEPSGCode(); const int otherMethodEPSGCode = otherSO->d->method_->getEPSGCode(); - const bool equivalentMethods = + bool equivalentMethods = (criterion == util::IComparable::Criterion::EQUIVALENT && methodEPSGCode != 0 && methodEPSGCode == otherMethodEPSGCode) || d->method_->_isEquivalentTo(otherSO->d->method_.get(), criterion); + if (!equivalentMethods && + criterion == util::IComparable::Criterion::EQUIVALENT) { + if ((methodEPSGCode == EPSG_CODE_METHOD_LAMBERT_AZIMUTHAL_EQUAL_AREA && + otherMethodEPSGCode == + EPSG_CODE_METHOD_LAMBERT_AZIMUTHAL_EQUAL_AREA_SPHERICAL) || + (otherMethodEPSGCode == + EPSG_CODE_METHOD_LAMBERT_AZIMUTHAL_EQUAL_AREA && + methodEPSGCode == + EPSG_CODE_METHOD_LAMBERT_AZIMUTHAL_EQUAL_AREA_SPHERICAL) || + (methodEPSGCode == EPSG_CODE_METHOD_EQUIDISTANT_CYLINDRICAL && + otherMethodEPSGCode == + EPSG_CODE_METHOD_EQUIDISTANT_CYLINDRICAL_SPHERICAL) || + (otherMethodEPSGCode == EPSG_CODE_METHOD_EQUIDISTANT_CYLINDRICAL && + methodEPSGCode == + EPSG_CODE_METHOD_EQUIDISTANT_CYLINDRICAL_SPHERICAL)) { + auto geodCRS = + dynamic_cast<const crs::GeodeticCRS *>(sourceCRS().get()); + auto otherGeodCRS = dynamic_cast<const crs::GeodeticCRS *>( + otherSO->sourceCRS().get()); + if (geodCRS && otherGeodCRS && geodCRS->ellipsoid()->isSphere() && + otherGeodCRS->ellipsoid()->isSphere()) { + equivalentMethods = true; + } + } + } if (!equivalentMethods) { if (criterion == util::IComparable::Criterion::EQUIVALENT) { |
