[geos-devel] buffer 0 distance

Martin Davis mbdavis at VividSolutions.com
Thu Dec 11 11:35:25 EST 2003


This behaviour is correct.  Buffer is defined to always return a polygon.  Thus the 0-width buffer of a LineString is indeed the empty GeometryCollection.

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.
Suite #1A-2328 Government Street   Victoria, B.C.   V8T 5G5
Phone: (250) 385 6040 - Local 308      Fax: (250) 385 6046



> -----Original Message-----
> From: strk [mailto:strk at keybit.net]
> Sent: Thursday, December 11, 2003 4:33 AM
> To: geos-devel at geos.refractions.net
> Subject: [geos-devel] buffer 0 distance
> 
> 
> I've found no special handling for buffer calls with
> 0 as the distance parameter, but indeed it seems to
> be needed since on buffer('LINESTRING(0 0, 45 54)', 0)
> call a 'GEMETRYCOLLECTION(EMPTY)' is returned.
> 
> Do you all think returning a clone of the passed geometry
> is a good policy when asked to return a buffer(0) of it ?
> 
> Please let me know.
> 
> --strk;
> 
> PS: Dave, I've discovered this trying again aime's bug.
>     the buffer(geom,0) was returning a different geometry
>     then the input once. After modification of the BufferOp
>     made sure result was exact copy of input the bug showed
>     again. 
> 
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel
> 



More information about the geos-devel mailing list