locationtech / jts

The JTS Topology Suite is a Java library for creating and manipulating vector geometry.
Other
1.98k stars 443 forks source link

Buffer behaviour for closed LineStrings #877

Closed mwtoews closed 2 years ago

mwtoews commented 2 years ago

Testing with JTS 1.18.3 or since GEOS 3.9.x the buffer behavior changed for closed LineStrings. For example:

LINESTRING (-13 8, 13 4, 14 -15, -16 -9, -13 8)

Buffer(5) is expected: image

Buffer(25) is expected: image

Buffer(27) has unexpected interior: image

Buffer(35) has unexpected interior that intersects part of the input: image

Buffer(60) has unexpected interior that contains the input: image

This is a regression since older versions, e.g. JTS 1.15 (not sure exactly when) or GEOS 3.8.1, which get expected results for each example.

(Also, for reference this started from a discussion at https://github.com/shapely/shapely/discussions/1405)

mwtoews commented 2 years ago

Also, there's nothing particularly unique with the example. For something different, see LINESTRING (0 0, 0 5, 5 5, 5 0, 0 0) with buffer(10). image

mwtoews commented 2 years ago

Doing a few version bisections, I've discovered that this regression was introduced with JTS 1.17.0.

mprins commented 2 years ago

This seems a duplicate of #876

mwtoews commented 2 years ago

Thanks, it is a duplicate!

dr-jts commented 2 years ago

Thanks for the detailed bug report. A fix has been found and a patch will be in place soon (in JTS and GEOS).