Skip to content

Fix centroid calculation for points around the antimeridian#22

Merged
5k4nd merged 4 commits into
8.xfrom
fix/antimeridian_centroid
Dec 3, 2025
Merged

Fix centroid calculation for points around the antimeridian#22
5k4nd merged 4 commits into
8.xfrom
fix/antimeridian_centroid

Conversation

@5k4nd

@5k4nd 5k4nd commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

Fixes #15

@5k4nd 5k4nd requested review from folkvir and garaud December 2, 2025 18:39
@5k4nd 5k4nd changed the base branch from master to 8.x December 2, 2025 18:39
@folkvir

folkvir commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

Question: what about parallels? 🤔

@garaud

garaud commented Dec 3, 2025

Copy link
Copy Markdown

Question: what about parallels? 🤔

Good question. About the latitude, you cannot have coordinates close to each other when you have ~90 degrees and -90 degrees. So the weighted average computation will be good.

@garaud garaud left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work. I left a suggestion for the tests.

@folkvir

folkvir commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

We also need to backport this into last v7 version. (same for the centroid fix)

@folkvir folkvir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@5k4nd 5k4nd merged commit 4a8bb69 into 8.x Dec 3, 2025
1 check passed
@5k4nd 5k4nd deleted the fix/antimeridian_centroid branch December 3, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calculation of centroid for locations near the 180th meridian (antimeridian) is incorrect

3 participants