Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 9.3] Ellipsoid::_isEquivalentTo(): fix so that an ellipsoid of semi-major … #3882

Merged
merged 1 commit into from Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/iso19111/datum.cpp
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
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