<div dir="ltr"><div><div><div><div><div>I'm trying to aggregate elements of a topology into a more aggregated layer. <br></div><br>The more disagregated layer, lets call the "sectors" was created by importing from a geometries table with the following code.  <br><br>SELECT topology.CreateTopology('topo_AC',32719);<br>SELECT topology.addtopogeometrycolumn('topo_AC', 'public','temp_geom_ac','tg_geom_dump_utm','POLYGON');<br>UPDATE temp_geom_ac SET tg_geom_dump_utm = toTopoGeom(geom_dump_utm,'topo_AC', 1, 1) ;<br><br></div>Then, following the example at <a href="http://postgis.net/docs/CreateTopoGeom.html">http://postgis.net/docs/CreateTopoGeom.html</a> , I created the "cities" table and added the "tg_cities" topogeom. <br><br></div>Finally, I tryed to add content to "tg_cities", with the this code:<br><br><br>UPDATE cities <br>SET tg_cities = CreateTopogeom( 'topo_AC',3,1,foo.city_faces)<br>FROM(    SELECT     substring(cod_set,1,7) AS cod_mun, <br>        TopoElementArray_Agg(ARRAY[(tg_geom_dump_utm).id,(tg_geom_dump_utm).layer_id]) AS city_faces<br>    FROM temp_geom_ac<br>    GROUP BY substring(cod_set,1,7) <br>     ) as foo<br>WHERE  cities.cod_mun=foo.cod_mun<br><br></div>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". <br></div>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 <var class="">layer_id. </var> <div><br></div><div><br></div><div>regards<br></div><div>Lucas<br></div><div><br><div><br><div><br><br> tryed to create the more aggregated "cities" table<br></div></div></div></div>