[postgis-users] Topology: error creating aggregated topogeom (at city level) from a neighborhoods topogeom

Lucas Ferreira Mation lucasmation at gmail.com
Wed Jan 27 05:08:55 PST 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20160127/b3407451/attachment.html>


More information about the postgis-users mailing list