[postgis-devel] Re: [PostGIS] #101: ST_Union on one-row table doesn't union

Martin Davis mbdavis at refractions.net
Thu Jun 4 11:52:42 PDT 2009


Paul, Regina:

Since valid MultiPolygons can't intersect except at points, the union of 
a MultiPolygon is exactly that MultiPolygon.  So technically the 
short-circuit in the PostGIS code is reasonable.

However, it's useful behaviour to be able to use Unary Union to "clean 
up" self-intersecting MultiPolygons.  This is the way JTS works.  It 
*always* performs a union, even on a single geometry.  This also allows 
Unary Union to be used as a simple way of noding a set of linestrings 
(since the union of linestrings doesn't merge resultants together).

So I'd vote for removing the optimization from PostGIS - or at least 
providing an entry point to Unary Union which always does some crunching.

Martin

PostGIS wrote:
> #101: ST_Union on one-row table doesn't union
> ----------------------+-----------------------------------------------------
>   Reporter:  pramsey  |       Owner:  pramsey      
>       Type:  defect   |      Status:  closed       
>   Priority:  medium   |   Milestone:  postgis 1.4.0
>  Component:  postgis  |     Version:  1.4          
> Resolution:  invalid  |    Keywords:               
> ----------------------+-----------------------------------------------------
> Comment (by pramsey):
>
>  It's just that it's a change in behavior... I dunno.
>
>  WRT your other question the answer is: it's a totally different code path.
>  And yeah, it seems to be deep in the heart of GEOS. It's probably a
>  similar short-circuit though (oh, hey, one side of my arguments is empty!
>  i'm done!)
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>   

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




More information about the postgis-devel mailing list