| 1 | Currently, [wiki:UsersWikiTopoGeometry TopoGeometry] objects can only be defined by specifying their |
| 2 | component topology elements. We do support both basic !TopoGeometry |
| 3 | and hierarchical !TopoGeometry. Basic !TopoGeometry objects are those |
| 4 | composed by base topolocal elements (faces, edges, nodes). Hierarchical |
| 5 | !TopoGeometry objects are composed by other !TopoGeometry objects. |
| 6 | |
| 7 | Each !TopoGeometry object belongs to a specific Layer of a specific |
| 8 | Topology. Before creating a !TopoGeometry object you need to create |
| 9 | its !TopologyLayer. A Topology Layer is an association of |
| 10 | a feature-table with the topology. It also contain type and hierarchy |
| 11 | information. We create a layer using the AddTopoGeometryColumn() function: |
| 12 | |
| 13 | {{{ |
| 14 | topology.AddTopoGeometryColumn(topology_name, |
| 15 | schema_name, table_name, column_name, feature_type, |
| 16 | [wiki:UsersWiki[child_layer [child_layer]) |
| 17 | |
| 18 | }}} |
| 19 | |
| 20 | The function will both add the requested column to the table and add |
| 21 | a record to the topology.layer table with all the given info. |
| 22 | |
| 23 | If you don't specify [wiki:UsersWiki[child_layer [child_layer] (or set it to NULL) this layer |
| 24 | would contain Basic !TopoGeometries (composed by primitive topology |
| 25 | elements). Otherwise this layer will contain hierarchical !TopoGeometries |
| 26 | (composed by !TopoGeometries from the child_layer). |
| 27 | |
| 28 | Once the layer is created (it's id is returned by the AddTopoGeometryColumn |
| 29 | function) you're ready to construct !TopoGeometry objects in it: |
| 30 | |
| 31 | |
| 32 | {{{ |
| 33 | topology.CreateTopoGeom( |
| 34 | topology_name, |
| 35 | feature_type, -- 1:(multi)point, 2:(multi)line, |
| 36 | -- 3:(multi)poly, 4:collection |
| 37 | layer_id, -- as returned by AddTopoGeometryColumn |
| 38 | TopoElementArray |
| 39 | ); |
| 40 | |
| 41 | }}} |