locationtech / locationtech/spatial4j
JtsGeometry.getBuffered doesn't buffer across the dateline
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 961
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Description
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
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 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