Skip to content

Commit

Permalink
GeographicCRS::_isEquivalentTo(): follow-up fix for #3879 to avoid be…
Browse files Browse the repository at this point in the history
…haviour breakage in GDAL
  • Loading branch information
rouault committed Sep 7, 2023
1 parent 10bd129 commit 140b991
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/iso19111/crs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3137,12 +3137,20 @@ bool GeographicCRS::_isEquivalentTo(
const auto standardCriterion = getStandardCriterion(criterion);
if (GeodeticCRS::_isEquivalentToNoTypeCheck(other, standardCriterion,
dbContext)) {
// Make sure GeoPackage "Undefined geographic SRS" != EPSG:4326
const auto otherGeogCRS = dynamic_cast<const GeographicCRS *>(other);
if ((nameStr() == "Undefined geographic SRS" ||
otherGeogCRS->nameStr() == "Undefined geographic SRS") &&
otherGeogCRS->nameStr() != nameStr()) {
return false;
}
return true;
}
if (criterion !=
util::IComparable::Criterion::EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS) {
return false;
}

const auto axisOrder = coordinateSystem()->axisOrder();
if (axisOrder == cs::EllipsoidalCS::AxisOrder::LONG_EAST_LAT_NORTH ||
axisOrder == cs::EllipsoidalCS::AxisOrder::LAT_NORTH_LONG_EAST) {
Expand Down

0 comments on commit 140b991

Please sign in to comment.