locationtech / locationtech/jts

Buffer on simple Polygon producing invalid MultiPolygon

Open
#1,180 0 comments 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

Hi Martin,

Here is a simple Polygon producing an invalid MultiPolygon made of two overlapping components :
Maybe related to cap_square or join_mitre options though.
BufferParameters(0, BufferParameters.CAP_SQUARE, BufferParameters.JOIN_MITRE, 10.0);
dist = 0.016986392749407057
POLYGON (( 456250.8302317833 6234702.580742284, 456250.1749609392 6234701.14307723, 456231.5018382939 6234710.059491986, 456231.89092938113 6234711.497619587, 456237.5900408879 6234708.814401538, 456237.62898463884 6234708.765721849, 456237.61786614324 6234708.801301035, 456250.8302317833 6234702.580742284 ))

original
Image

buffered

Image

An early adopter

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 by reproducing the supplied WKT with BufferParameters using CAP_SQUARE, JOIN_MITRE, and the given distance. Inspect the resulting MultiPolygon for overlapping components and invalidity; done means the same input produces a valid buffered geometry.

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.