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

Incorrect Result from LatLon's getCenter(Iterable<? extends LatLon>) Method #237

Open
OneDeuxTriSeiGo opened this issue Dec 7, 2021 · 0 comments

Comments

@OneDeuxTriSeiGo
Copy link

Description

One of LatLon's getCenter() methods seems to produce the wrong result when the iterable of LatLons/Positions passed in cross over the Prime Meridian.

Specific Method: https://github.com/NASAWorldWind/WorldWindJava/blob/develop/src/gov/nasa/worldwind/geom/LatLon.java#L1128

Steps to Reproduce

  1. Create a sequence of points that are on both sides of the prime meridian: (1,1), (1, -1), (-1, -1), (-1, 1).
  2. Pass this sequence of points into LatLon.getCenter(Iterable<? extends LatLon> locations)
  3. The result shows up on approximately the opposite side of the globe from where the center should be.

Expected behavior: The result should be in the center of the points provided.

Actual behavior: The resulting point is on the opposite side of the globe as the expected center point.

Reproduces how often: 100% of the time.

Operating System and Version

  • OS: WIndows 10
  • Library Version: v2.2.0

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

@OneDeuxTriSeiGo OneDeuxTriSeiGo changed the title Incorrect Result from LatLon getCenter(Iterable<? extends LatLon>) Method Incorrect Result from LatLon's getCenter(Iterable<? extends LatLon>) Method Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant