Opened 13 years ago
Closed 13 years ago
#434 closed defect (fixed)
Invalid (?) buffer output [JTS works]
Reported by: | yabo | Owned by: | strk |
---|---|---|---|
Priority: | major | Milestone: | 3.3.0 |
Component: | Core | Version: | main |
Severity: | Content | Keywords: | |
Cc: |
Description
Hi,
I'm facing a case where a buffer returns an empty polygon while I believe it shouldn't.
I attached a C++ program demonstrating the problem. I tried it against geos 3.2.2 and geos-svn r2999.
The problem is in the negative buffer of a polygon. For a given value it works perfectly (image attached) but if in increase this value by one it returns an empty polygon which, given the picture, it shouldn't (or I believe so at least).
Attachments (2)
Change History (9)
by , 13 years ago
by , 13 years ago
Attachment: | buffer.png added |
---|
In blue the original polygon, in pink the last working negative buffer.
comment:2 by , 13 years ago
I'm not sure to understand the question. I'm using no SRID (ie, -1), so it's "one" as in the length of 'LINESTRING(0 0, 0 1)', or in this case the difference between -9501 and -9502 for the buffer. Compared to the size of the geometry, 'one' is very small, almost un-noticeable (area of the geometry: 72083121486).
comment:3 by , 13 years ago
Milestone: | → 3.3.0 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:4 by , 13 years ago
Component: | Default → Core |
---|---|
Severity: | Unassigned → Content |
Summary: | Invalid (?) buffer output → Invalid (?) buffer output [JTS works] |
Bug confirmed. JTS 1.12 doesn't have this problem.
comment:5 by , 13 years ago
OffsetCurveSetBuilder::addPolygon thinks the polygon shell would be completely eroded by the buffer distance.
comment:6 by , 13 years ago
It turns out GEOS, contrary to JTS, was using an heuristic based on MinimumDiameter to figure if a buffer would completely erode a ring or not. Disabling that heuristic (as done in JTS) fixes this case. But unfortunately it breaks 1 over 100 buffer tests we have in TestBufferExternal2.xml (JTS passes that as well).
.. I'm going on with debugging it ..
comment:7 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
r3291 fixes this. The other test failing was another missing heuristic based on envelope dimensions. GEOS regressions testsuite is excellent ! :)
Minimal testcase including the WKB of the polygon.