Creating a TopoGeometry column and a topology layer

TopoGeometry is a special data type. It doesn't store real geometry, merely an array of topological elements' IDs, but it can be visualized in GIS software, or used in spatial SQL queries, like an ordinary Simple Feature geometry, which will be composed on the fly. A new TopoGeometry column is created with a non-standard topology.AddTopoGeometryColumn function. It accepts the following arguments:

  • topology_name: Denoting the name of topology which should be linked with the feature data
  • schema_name: Name of schema where the feature table resides
  • table_name: Name of the feature table
  • column_name: Name for the newly created TopoGeometry column
  • geometry_type: Geometry type for newly created TopoGeometry, one of: POINT, LINE, POLYGON, COLLECTION

For our example, the SQL statement will look like this:

SELECT topology.AddTopoGeometryColumn('my_topology','public','countries','topogeom','POLYGON'); 

After executing, a new row appears in the topology.layer table:

A topology layer registered in a metadata table

Also, a new column, topogeom, is added to the public.countries table. But for now, all rows have NULL values there. To populate the newly created TopoGeometry column from an existing Geometry, another function has to be used.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset