Skip to content

Commit

Permalink
Merge pull request #3880 from rouault/fix_ellipsoid_isequivalentto
Browse files Browse the repository at this point in the history
Ellipsoid::_isEquivalentTo(): fix so that an ellipsoid of semi-major …
  • Loading branch information
rouault authored Sep 5, 2023
2 parents d750d68 + b10ac5e commit 5839498
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 5839498

Please sign in to comment.