[postgis-users] Merging two overlapping polygons

Alexandre Dube adube at mapgears.com
Wed Sep 30 07:20:10 PDT 2009


Hi,

  I'm looking for a way to merge two overlapping polygons with a sql 
statement.  I've been searching/trying things for a while and still no 
results.

  So far, I'm able to merge all polygons in one using :

SELECT GeomUnion(geom) FROM (SELECT (dump(the_geom)).geom FROM mytable) 
AS s;

  but if I have a third polygon not overlapping the other two, it 
returns a single multipolygon with all three together.

  Any hint ?

-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the postgis-users mailing list