Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

JtsGeometry.unwrapDateline creates an invalid polygon in some cases

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

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
backend

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.

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.

Dominant language
Java
Stars
962
Forks
174
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from locationtech/spatial4j

All issues in locationtech/spatial4j

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.