From 3a67ea87fac5b835df7966fa801881eaf7503e78 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 6 Oct 2021 19:21:03 +0200 Subject: ProjectedCRS::_isEquivalentTo(): ignore base CRS axis order even in EQUIVALENT mode if one of them is lacking an explicit CS order (refs #2886) --- src/iso19111/crs.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/iso19111/crs.cpp b/src/iso19111/crs.cpp index b48f0d70..731bf7f9 100644 --- a/src/iso19111/crs.cpp +++ b/src/iso19111/crs.cpp @@ -4171,6 +4171,17 @@ ProjectedCRS::create(const util::PropertyMap &properties, bool ProjectedCRS::_isEquivalentTo( const util::IComparable *other, util::IComparable::Criterion criterion, const io::DatabaseContextPtr &dbContext) const { + auto otherProjCRS = dynamic_cast(other); + if (otherProjCRS != nullptr && + criterion == util::IComparable::Criterion::EQUIVALENT && + (d->baseCRS_->hasImplicitCS() || + otherProjCRS->d->baseCRS_->hasImplicitCS())) { + // If one of the 2 base CRS has implicit coordinate system, then + // relax the check. The axis order of the base CRS doesn't matter + // for most purposes. + criterion = + util::IComparable::Criterion::EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS; + } return other != nullptr && util::isOfExactType(*other) && DerivedCRS::_isEquivalentTo(other, criterion, dbContext); } -- cgit v1.2.3