locationtech / locationtech/spatial4j

unwrapDateline on a polygon with a hole

Open
#220 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
961
Forks
172
PR merge metrics
No merged PRs in 30d

Description

https://github.com/locationtech/spatial4j/blob/2926812ae302c6e0f24fb5995b1fd24be7fe0b56/src/main/java/org/locationtech/spatial4j/shape/jts/JtsGeometry.java#L492

Why does this check in unwrapDateline() require the exterior ring of a polygon to contains() any interior rings? Doesn't contains() on two LineStrings require one to be a subset of the other? If so, you wouldn't be able to have polygons that contain holes and cross the dateline, which is the problem I'm running into.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/main/java/org/locationtech/spatial4j/shape/jts/JtsGeometry.java#L492 and inspect the contains() check in unwrapDateline() for polygons with interior rings. Reproduce the reported polygon-with-hole case, then clarify or correct the dateline-unwrapping behavior so valid holes are handled consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.