On Wed, Apr 11, 2012 at 01:40:01PM +0200, Nicolas Ribot wrote: > Method 1: using one SQL query: > > select (st_dump(st_polygonize(distinct geom))).geom as geom > from ( > select (st_dump(st_simplifyPreserveTopology(st_linemerge(st_union(geom)), > 10000))).geom as geom > from ( > select st_exteriorRing((st_dumpRings(geom)).geom) as geom > from expl_dep > ) as foo > ) as bar; > > -- takes 6.1 to 6.4 seconds
... > Method 2, using topology wrapped in a function: > (topo1 and topo2 are created outside the function): > > create or replace function testSimplTopo() returns text as $$ > > select ST_CreateTopoGeo('topo1',ST_Collect(geom)) > from expl_dep; > > select ST_CreateTopoGeo('topo2', geom) > from ( > select ST_Collect(st_simplifyPreserveTopology(geom, 10000)) as geom > from topo1.edge_data > ) as foo; > > $$ language sql; > > -- takes 12.0 to 12.3 seconds. Why are you populating 'topo1' topology at all ? You're doing the hard work twice, which matches the double time it takes compared with the direct call. --strk; ,------o-. | __/ | Delivering high quality PostGIS 2.0 ! | / 2.0 | http://strk.keybit.net - http://vizzuality.com `-o------' _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users