locationtech / locationtech/spatial4j
JtsGeometry.unwrapDateline creates an invalid polygon in some cases
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 961
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Description
Start with this Geometry:
POLYGON ((-180 -24.5271348, -180 0.9447814, 180 0.9447814, 180 -24.5271348, -180 -24.5271348))
Pass it to a JtsGeometry, and when unwrapDateline is called during initialization, it modifies to the following:
POLYGON ((180 -24.5271348, 180 0.9447814, 180 0.9447814, 180 -24.5271348, 180 -24.5271348))
That's not a valid polygon; note that all the -180 longitudes are now 180, so all of those points are on a straight line.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with JtsGeometry initialization and the unwrapDateline path, using the WKT polygon in the issue to reproduce the conversion. Done means the example remains a valid polygon after initialization and does not collapse all -180 longitudes to 180.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100