locationtech / locationtech/spatial4j
WKTReader returns Envelope instead of Polygon
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 961
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Description
When supplying a rectangle wktstring (POLYGON ((14 53, 13 53, 13 52, 14 52, 14 53))) to the WKTReader, the WKTReader returns an Envelope (ENVELOPE (13, 14, 53, 52)).
I find this non intuitive, as I would expect it to not change the "shape form". Is there a possibility to
- prevent the WKTReader from "optimizing" the shape form?
- or, to change the polygon shape "object" to an envelope shape "object" without readers/writers?
I guess this would also happen with other shapes, e.g., a circle, right?
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 by reproducing the rectangle WKT case through WKTReader and inspect how the Polygon is represented as an Envelope. Review the existing discussion to determine whether the intended outcome is preserving the Polygon or adding a separate conversion path; completion should include an agreed behavior and tests for the reported case.
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
- Needs clarification
- Newbie friendliness
- 35/100