Skip to content

Commit

Permalink
Merge pull request #3882 from OSGeo/backport-3880-to-9.3
Browse files Browse the repository at this point in the history
[Backport 9.3] Ellipsoid::_isEquivalentTo(): fix so that an ellipsoid of semi-major …
  • Loading branch information
rouault authored Sep 6, 2023
2 parents 9f99f30 + 069e463 commit fd5caa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/iso19111/datum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ bool Ellipsoid::_isEquivalentTo(const util::IComparable *other,
}

} else {
if (!otherEllipsoid->computeSemiMinorAxis()._isEquivalentTo(
if (!computeSemiMinorAxis()._isEquivalentTo(
otherEllipsoid->computeSemiMinorAxis(), criterion)) {
return false;
}
Expand Down
6 changes: 6 additions & 0 deletions test/unit/test_datum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ TEST(datum, ellipsoid_from_inverse_flattening) {

EXPECT_FALSE(Ellipsoid::WGS84->isEquivalentTo(
Ellipsoid::GRS1980.get(), IComparable::Criterion::EQUIVALENT));

auto sphere = Ellipsoid::createSphere(PropertyMap(), Length(6378137));
EXPECT_FALSE(Ellipsoid::WGS84->isEquivalentTo(
sphere.get(), IComparable::Criterion::EQUIVALENT));
EXPECT_FALSE(sphere->isEquivalentTo(Ellipsoid::WGS84.get(),
IComparable::Criterion::EQUIVALENT));
}

// ---------------------------------------------------------------------------
Expand Down

0 comments on commit fd5caa1

Please sign in to comment.