Skip to content

Fix createBounds() throwing near the dateline, fixes #87 - #290

Open
pangwangshu wants to merge 1 commit into
davidmoten:masterfrom
pangwangshu:wapang/issue87
Open

Fix createBounds() throwing near the dateline, fixes #87#290
pangwangshu wants to merge 1 commit into
davidmoten:masterfrom
pangwangshu:wapang/issue87

Conversation

@pangwangshu

Copy link
Copy Markdown

Summary

  • `LatLongExampleTest.createBounds()` used the strict `Geometries.rectangle()`, which requires lon1 <= lon2 and throws when a search point near the antimeridian causes the westward predicted point to wrap to a positive longitude while the eastward point stays negative.
  • Switched to `Geometries.rectangleGeographic()`, which already normalizes longitude across the dateline, so the bounding box is built correctly instead of throwing.

Test plan

  • Added `testCreateBoundsNearDateline` reproducing the crash from issue position prediction fails for close-to-the-dateline #87; confirmed it throws `IllegalArgumentException` against the old `rectangle()` call and passes with `rectangleGeographic()`.
  • `mvn test`: 312 tests run, 0 failures, 0 errors.

Fixes #87

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.

position prediction fails for close-to-the-dateline

1 participant