I've a bunch of overlapping polygons and I'm trying to partition the space to avoid having overlapping ones. I think my problem is fairly simple. Using some ESRI product and http://arcscripts.esri.com/details.asp?dbid=16700 my co-worker computed it in 48s.
I'm trying to do it with postgis using http://s3.opengeo.org/postgis-power.pdf#page=24 (guessing the details, using http://trac.osgeo.org/postgis/wiki/UsersWikiSimplifyPreserveTopology as inspiration) but it's so slow that I can't do it with more than 10 polys (I've got 800 of them to split). The slow part is the ST_Union, I tried various things, but none where successful, here is the current state of affairs :
select geom from (select st_linemerge(st_union(geom)) as geom from (select st_exteriorring((st_dumprings((st_dump(t.geom)).geom)).geom) as geom from (SELECT geometry AS geom, id FROM tt WHERE campaign_id = 204 ORDER BY id limit 200) t) t2) t3
this has been computing for 26 min (the linemerge() is actually not ). The polys are MultiPolygons in case the st_dump bugs you.
Do you have any tip ? The st_union() of the linework is the very slow part.
PS: here are some numbers : 852 multipolygons, leading to 14880 polygons, leading to 21467 linestrings totaling 315513 vertices.