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)

test.cc (2.2 KB ) - added by yabo 13 years ago.
Minimal testcase including the WKB of the polygon.
buffer.png (57.3 KB ) - added by yabo 13 years ago.
In blue the original polygon, in pink the last working negative buffer.

Download all attachments as: .zip

Change History (9)

by yabo, 13 years ago

Attachment: test.cc added

Minimal testcase including the WKB of the polygon.

by yabo, 13 years ago

Attachment: buffer.png added

In blue the original polygon, in pink the last working negative buffer.

comment:1 by strk, 13 years ago

How big is "one" ? Ie: which distance value for the working buffer ?

comment:2 by yabo, 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 strk, 13 years ago

Milestone: 3.3.0
Owner: changed from geos-devel@… to strk
Status: newassigned

comment:4 by strk, 13 years ago

Component: DefaultCore
Severity: UnassignedContent
Summary: Invalid (?) buffer outputInvalid (?) buffer output [JTS works]

Bug confirmed. JTS 1.12 doesn't have this problem.

comment:5 by strk, 13 years ago

OffsetCurveSetBuilder::addPolygon thinks the polygon shell would be completely eroded by the buffer distance.

comment:6 by strk, 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 strk, 13 years ago

Resolution: fixed
Status: assignedclosed

r3291 fixes this. The other test failing was another missing heuristic based on envelope dimensions. GEOS regressions testsuite is excellent ! :)

Note: See TracTickets for help on using tickets.