[geos-devel] [GEOS] #241: GEOSBuffer produces an invalid geometry
GEOS
geos-trac at osgeo.org
Thu Mar 19 12:49:49 EDT 2009
#241: GEOSBuffer produces an invalid geometry
------------------------+---------------------------------------------------
Reporter: pleroux | Owner: geos-devel at lists.osgeo.org
Type: defect | Status: new
Priority: major | Milestone: 3.1.1
Component: Default | Version: 3.0.0
Severity: Unassigned | Keywords:
------------------------+---------------------------------------------------
Here's a a valid polygon for which the GEOSBuffer function produces an
invalid geometry.
At the beginning, I didn't test the returned geometry but only wrote it in
WKT format (and it "worked"). I tested different values for dist (1 (m)
and 2) and, with 1, it is obvious than the result is not valid (a big hole
of the poygon disappears and two small polygons are created). With 2, it
"seems" good and the obvious error obtained with 1 don't occur any more.
Even if they are not valid, I think they're interesting to investigate
{{{
>>> from shapely.wkb import loads
>>> polygon =
loads(open('polygon.hexwkb').readline().rstrip().decode('hex'))
>>> polygon.is_valid
True
>>> buffer_1 = polygon.buffer(1.)
>>> buffer_1.is_valid
False
>>> buffer_2 = polygon.buffer(2.)
>>> buffer_2.is_valid
False
>>> print >> open('buffer_1.hexwkb','w'), buffer_1.wkb.encode('hex')
>>> print >> open('buffer_2.hexwkb','w'), buffer_2.wkb.encode('hex')
}}}
On MacOSX, libgeos 3.0.0, with an equivalent code in C, the problem occurs
too.
--
Ticket URL: <http://trac.osgeo.org/geos/ticket/241>
GEOS <http://geos.refractions.net/>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
More information about the geos-devel
mailing list