[postgis-users] Merging two overlapping polygons

Alexandre Dube adube at mapgears.com
Thu Oct 1 09:04:02 PDT 2009


Kevin,

That's a wonderful idea. I just tested it and it worked.

Thanks a lot,

Alexandre

Kevin Neufeld wrote:
> If I understand correctly, why don't you just ST_Union as you are 
> doing below, then wrap the results in ST_Dump to explode the MULTI 
> result. Then you'll have your merged polygon where they overlap as 
> well as any individual lone-ranger polygons.
>
> SELECT (ST_Dump(singlegeom)).geom
> FROM (
> SELECT ST_Multi(ST_Union(f.the_geom)) as singlegeom
> FROM mytable
> ) AS foo;
>
> -- Kevin
>


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the postgis-users mailing list