locationtech / locationtech/jts

The geometry's SRID unexpectedly resets to 0 (EPSG:0) after spatial operations like buffer.

Open
#1,152 1 comment 0 reactions 0 assignees View on GitHub

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.