locationtech / locationtech/jts
The geometry's SRID unexpectedly resets to 0 (EPSG:0) after spatial operations like buffer.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2.2k
- Forks
- 475
- Avg merge
- 14d 10h
- Merged PRs (30d)
- 1
Description
import org.locationtech.jts.geom._
val geometryFactory :GeometryFactory= new GeometryFactory()
val coor=new Coordinate(116.0, 36.0)
val geom: Geometry = geometryFactory.createPoint(coor)
geom.setSRID(4326)
val bufferGeom=geom.buffer(0.5)
println(bufferGeom.getSRID) //result: 0
This result is unexpected because it requires manually setting the SRID each time, which is inconvenient.
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
Reproduce the reported geometryFactory, point, SRID 4326, and buffer sequence, then trace the buffer operation's handling of the resulting geometry metadata. Look for existing geometry-operation tests covering SRID propagation and add a regression case if the relevant test location is found. Done means the buffered geometry retains the expected SRID without manual resetting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, scala
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100