1.1 Main Steps in Using Topology Data

This topic summarizes the main steps for working with topology data.

It refers to important concepts, structures, and operations that are described in detail in other topics.

The specific main steps depend on which of two basic approaches you follow, which depend on the kind of data you will use to build the topology:

You can use the Topology Data Model PL/SQL and Java APIs to update the topology (for example, to change the data about an edge, node, or face). The PL/SQL API for most editing operations is the SDO_TOPO_MAP package, which is documented in SDO_TOPO_MAP Package Subprograms. The Java API is described in Topology Data Model Java Interface.

1.1.1 Using a Topology Built from Topology Data

The main steps for working with a topology built from topology data are as follows:

  1. Create the topology, using the SDO_TOPO.CREATE_TOPOLOGY procedure. This causes the <topology-name>_EDGE$, <topology-name>_NODE$, <topology-name>_FACE$, and <topology-name>_HISTORY$ tables to be created. (These tables are described in Edge Information Table, Node Information Table, Face Information Table, and History Information Table, respectively.)
  2. Load topology data into the node, edge, and face tables created in Step 1. This is typically done using a bulk-load utility, but it can be done using SQL INSERT statements.
  3. Create a feature table for each type of topology geometry layer in the topology. For example, a city data topology might have separate feature tables for land parcels, streets, and traffic signs.
  4. Associate the feature tables with the topology, using the SDO_TOPO.ADD_TOPO_GEOMETRY_LAYER procedure for each feature table. This causes the <topology-name>_RELATION$ table to be created. (This table is described in Relationship Information Table.)
  5. Initialize topology metadata, using the SDO_TOPO.INITIALIZE_METADATA procedure. (This procedure also creates spatial indexes on the <topology-name>_EDGE$, <topology-name>_NODE$, and <topology-name>_FACE$ tables, and additional B-tree indexes on the <topology-name>_EDGE$ and <topology-name>_NODE$ tables.)
  6. Load the feature tables using the SDO_TOPO_GEOMETRY constructor. (This constructor is described in SDO_TOPO_GEOMETRY Constructors.)
  7. Query the topology data (for example, using one of topology operators described in Topology Operators).
  8. Optionally, edit topology data using the PL/SQL or Java application programming interfaces (APIs).

Topology Built from Topology Data contains a PL/SQL example that performs these main steps.

1.1.2 Using a Topology Built from Spatial Geometries

To build a topology from spatial geometries, you must first perform the standard operations for preparing data for use with Oracle Spatial, as described in Oracle Spatial Developer's Guide:

  1. Create the spatial tables.

  2. Update the spatial metadata (USER_SDO_GEOM_METADATA view).

  3. Load data into the spatial tables.

  4. Validate the spatial data.

  5. Create the spatial indexes.

The main steps for working with a topology built from Oracle Spatial geometries are as follows:

  1. Create the topology, using the SDO_TOPO.CREATE_TOPOLOGY procedure. This causes the <topology-name>_EDGE$, <topology-name>_NODE$, <topology-name>_FACE$, and <topology-name>_HISTORY$ tables to be created. (These tables are described in Edge Information Table, Node Information Table, Face Information Table, and History Information Table, respectively.)
  2. Create the universe face (F0, defined in Topology Data Model Concepts).
  3. Create a feature table for each type of topology geometry layer in the topology. For example, a city data topology might have separate feature tables for land parcels, streets, and traffic signs.
  4. Associate the feature tables with the topology, using the SDO_TOPO.ADD_TOPO_GEOMETRY_LAYER procedure for each feature table. This causes the <topology-name>_RELATION$ table to be created. (This table is described in Relationship Information Table.)
  5. Initialize topology metadata, using the SDO_TOPO.INITIALIZE_METADATA procedure. (This procedure also creates spatial indexes on the <topology-name>_EDGE$, <topology-name>_NODE$, and <topology-name>_FACE$ tables, and additional B-tree indexes on the <topology-name>_EDGE$ and <topology-name>_NODE$ tables.)
  6. Create a TopoMap object and load the whole topology into cache.
  7. Load the feature tables, inserting data from the spatial tables and using the SDO_TOPO_MAP.CREATE_FEATURE function.
  8. Query the topology data (using one of topology operators described in Topology Operators).
  9. Optionally, edit topology data using the PL/SQL or Java application programming interfaces (APIs).

Topology Built from Spatial Geometries contains a PL/SQL example that performs these main steps.