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

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

Open
sergeykad opened this issue Nov 14, 2023 · 0 comments

Comments

@sergeykad
Copy link

sergeykad commented Nov 14, 2023

The centroid calculation, which simply averages latitude and longitude values, is accurate in most cases, but produces incorrect results near the 180th meridian. For example, with longitudes 179.649556 and -176.131694, the calculation is as follows:

(179.649556 - 176.131694) / 2 = 1.758931

As can be seen, the example produces results in the opposite hemisphere.

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

No branches or pull requests

1 participant