[postgis-users] Merging two overlapping polygons

Emilie Laffray emilie.laffray at gmail.com
Wed Sep 30 07:23:28 PDT 2009


2009/9/30 Alexandre Dube <adube at mapgears.com>

> 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 ?
>

Performing an intersect check would work I guess if you revamped your query
accordingly.

Emilie Laffray
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090930/673def99/attachment.html>


More information about the postgis-users mailing list