[postgis-users] Merge function in PostGIS

Bruce Rindahl rindahl at lrcwe.com
Tue Oct 31 11:38:36 PST 2006


Great!
Both work but the one I settled on is
SELECT simplify(buffer(the_geom,0.01),0.01)) from tablename;

I needed the buffer because the application is displaying shapes in SVG that
the user selects.  In the conversion to SVG and manipulating the display
some precision is lost so I needed to merge really close shapes.  The
simplify eliminates the extra points around the corners.

Thanks!
Bruce

-----Original Message-----
From: Paul Ramsey [mailto:pramsey at refractions.net] 
Sent: Monday, October 30, 2006 6:49 PM
To: PostGIS Users Discussion
Cc: rindahl at lrcwe.com
Subject: Re: [postgis-users] Merge function in PostGIS

Or, possibly:

select buffer(the_geom,0.01) from tablename where geometrytype =  
'MULTIPOLYGON';


On 30-Oct-06, at 5:34 PM, Michael Fuhr wrote:

> On Mon, Oct 30, 2006 at 01:50:26PM -0700, Bruce Rindahl wrote:
>> I need a merge function in PostGIS.  What this means is if I have a
>> multipolygon and if any two parts share a common edge I need the  
>> union of
>> the two parts in one polygon.  For example if I have:
>> MULTIPOLYGON(((partA)),((partB)),((partC))) where partA and partC  
>> intersect
>> or share a common edge, the result will be:
>> MULTIPOLYGON(((Union of partA & partC)),((partB)))
>
> Something like this might work:
>
> SELECT GeomUnion(geom)
> FROM (SELECT (dump(the_geom)).geom
>       FROM tablename
>       WHERE ...) AS s;
>
> -- 
> Michael Fuhr
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users







More information about the postgis-users mailing list