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

JtsGeometry.getBuffered doesn't buffer across the dateline

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

Nobody has claimed this yet.

Assessment

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

Research direction

Start in src/main/java/org/locationtech/spatial4j/shape/jts/JtsGeometry.java at line 177 and inspect the TODO around getBuffered. Reproduce buffering for a geometry next to the dateline, then verify that nearby geometry on the opposite side is included without generating invalid longitudes. Done means dateline-crossing buffers return geographically adjacent records correctly.

Written by the indexing model from the issue text.

Description

https://github.com/locationtech/spatial4j/blob/master/src/main/java/org/locationtech/spatial4j/shape/jts/JtsGeometry.java#L177

We are using the getBuffered method to find records that are near the record queried. It doesn't buffer across the dateline, though, so if the query record is next to the dateline, we won't find nearby records properly even though they are geographically close to the query record because the buffered geometry stops at the dateline.

There is a TODO to fix this. Any chance of this being improved? The current implementation is better than the homebrew implementation we were using, in that it at least stops at the dateline rather than generating invalid longitudes, so I am very appreciative of the existing work that's gone in.

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.