I'm trying to aggregate elements of a topology into a more aggregated layer.
The more disagregated layer, lets call the "sectors" was created by importing from a geometries table with the following code. SELECT topology.CreateTopology('topo_AC',32719); SELECT topology.addtopogeometrycolumn('topo_AC', 'public','temp_geom_ac','tg_geom_dump_utm','POLYGON'); UPDATE temp_geom_ac SET tg_geom_dump_utm = toTopoGeom(geom_dump_utm,'topo_AC', 1, 1) ; Then, following the example at http://postgis.net/docs/CreateTopoGeom.html , I created the "cities" table and added the "tg_cities" topogeom. Finally, I tryed to add content to "tg_cities", with the this code: UPDATE cities SET tg_cities = CreateTopogeom( 'topo_AC',3,1,foo.city_faces) FROM( SELECT substring(cod_set,1,7) AS cod_mun, TopoElementArray_Agg(ARRAY[(tg_geom_dump_utm).id,(tg_geom_dump_utm).layer_id]) AS city_faces FROM temp_geom_ac GROUP BY substring(cod_set,1,7) ) as foo WHERE cities.cod_mun=foo.cod_mun But I'm getting this error message: "ERROR: A TopoGeometry of type 3 cannot contain topology elements of type 1". I imagine the problem is with the 2nd and 3rd arguments of "CreateTopogeom". The role of the 2nd argument is pretty clear in the documentation, and I think it should be "3" = colletion of areas. However I don't really understand what is the 3rd argument, the integer layer_id. regards Lucas tryed to create the more aggregated "cities" table
_______________________________________________ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/postgis-users