[geos-devel] [GEOS] #241: GEOSBuffer produces an invalid geometry
Martin Davis
mbdavis at refractions.net
Thu Mar 19 13:01:34 EDT 2009
This seems fine in JTS 1.11. There's been several bug
fixes/improvements to the buffer code since it was last ported to GEOS,
I think - and any of them could be causing the problem.
Ah, the joys of two code bases.... gcj, anyone?
GEOS wrote:
> #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.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel
--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022
More information about the geos-devel
mailing list