locationtech / locationtech/spatial4j

JtsGeometry.getBuffered doesn't buffer across the dateline

Open
#187 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/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.

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 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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.