[geos-devel] Unary Union

Martin Davis mbdavis at refractions.net
Fri Feb 5 11:37:08 EST 2010


Note that UnaryUnion does NOT "clean" geometry in the same way that 
buffer(0) can.  If there are invalid geometries in the input to 
UnaryUnion, it will probably fail.  It also might be a bit more subject 
to robustness failures (eg two polygons with almost coincident segments).

But UnaryUnion should be faster and more accurate than buffer(0) when it 
does work (which should be almost always for valid input.

Also, UnaryUnion works for LineString and Point input, and general 
GeometryCollections.

Sandro Santilli wrote:
> On Fri, Feb 05, 2010 at 02:28:20PM +0100, Sandro Santilli wrote:
>   
>> On Fri, Feb 05, 2010 at 01:58:14PM +0100, Sandro Santilli wrote:
>>     
>>> On Fri, Feb 5, 2010 at 12:29 PM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
>>>       
>>>> Seems to be in the 3.2.0/1.6.0 C API as GEOSUnionCascaded(), and works like
>>>> the buffer trick for me (except for my unsolved scale problem).
>>>>         
>>> I've checked the GEOS code. It's actually NOT the same classes being
>>> used for CascadedUnion and UnaryUnion. Dunno about the actual
>>> output characteristic, but it's surely documented (in JTS) to be different
>>> from the buffer trick.
>>>       
>> Oope, you were right. At least for polygons, it's the same
>> of UnionCascaded.
>>     
>
> ... except postgis just returns the input geometry w/out even asking
> GEOS to do anything with it (for single-geometry inputs) ...
>
> -

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022



More information about the geos-devel mailing list