[postgis-users] Merging two overlapping polygons

Alexandre Dube adube at mapgears.com
Wed Sep 30 07:40:46 PDT 2009


Emilie,

Emilie Laffray wrote:
>
> Performing an intersect check would work I guess if you revamped your 
> query accordingly.
>

Thanks for the help.

OK, using ST_Intersects should be fine when using only 2 geometries, but 
how can I use this in a query on a table containing more than 15000 rows ?

ST_Union worked and returned a single multipolygon, that's a good 
start.  Is it possible to merge "intersecting" polygons only in a 
statement ?

So far :

SELECT mycolumn, ST_Multi(ST_Union(f.the_geom)) as singlegeom FROM 
mytable As f GROUP BY mycolumn;

(btw, mycolumn has the same value for every row, i.e. is null)

Thanks a lot,

> Emilie Laffray
> ------------------------------------------------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the postgis-users mailing list