# [postgis-users] Split multiple overlapping polygons to polygonsthat do not overlap.

Paragon Corporation lr at pcorp.us
Sun Oct 25 14:37:03 PDT 2009

```Paul,

Not sure if this would help, but I suspect what Kevin has posted here may be
close to what you want.

http://trac.osgeo.org/postgis/wiki/UsersWikiSplitPolygonWithLineString

Except in your case, you would ST_Union(ST_Boundary(the_geom)) but then the
rest of what he has should be about right.

Hope that helps,
Regina

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Moen,
Paul T.
Sent: Thursday, October 22, 2009 12:24 PM
To: PostGIS Users Discussion
Subject: [postgis-users] Split multiple overlapping polygons to polygonsthat
do not overlap.

I have a set of polygons.

INSERT INTO test(gid,the_geom) VALUES (1,st_geomfromtext('MULTIPOLYGON
(((1 5,1 9,5 9,5 5,1 5)))',2266));
INSERT INTO test(gid,the_geom) VALUES (2,st_geomfromtext('MULTIPOLYGON
(((4 2,4 6,8 6,8 2,4 2)))',2266));
INSERT INTO test(gid,the_geom) VALUES (3,st_geomfromtext('MULTIPOLYGON
(((4 3,4 6,7 6,7 3,4 3)))',2266));
INSERT INTO test(gid,the_geom) VALUES (4,st_geomfromtext('MULTIPOLYGON
(((4 5,4 8,7 8,7 5,4 5)))',2266));
INSERT INTO test(gid,the_geom) VALUES (5,st_geomfromtext('MULTIPOLYGON
(((2 3,2 6,5 6,5 3,2 3)))',2266));
They look like the image below with the transparency set so the overlaps are
visible.

```