4.1 SDO_TOPO_MAP.ADD_EDGE

Format

SDO_TOPO_MAP.ADD_EDGE(     
  topology IN VARCHAR2,      
  node_id1 IN NUMBER,      
  node_id2 IN NUMBER,      
  geom     IN SDO_GEOMETRY      
) RETURN NUMBER;

Description

Adds an edge to a topology, and returns the edge ID of the added edge.

Parameters

topology

Name of the topology to which to add the edge, or null if you are using an updatable TopoMap object (see Specifying the Editing Approach with the Topology Parameter). Must not exceed 20 characters.

node_id1

Node ID of the start node for the edge to be added.

node_id2

Node ID of the end node for the edge to be added.

geom

SDO_GEOMETRY object (line or contiguous line string geometry) representing the edge to be added.

Usage Notes

Spatial automatically assigns an edge ID to the added edge. If topology is not null, the appropriate entry is inserted in the <topology-name>_EDGE$ table; and if the addition of the edge affects the face information table, the appropriate entries in the <topology-name>_FACE$ table are updated. (If topology is null, you can update these tables at any time by calling the SDO_TOPO_MAP.UPDATE_TOPO_MAP procedure.)

If node_id1 and node_id2 are the same value, a loop edge is created.

For information about adding and deleting nodes and edges, see Editing Topologies .

This function is equivalent to using the addEdge method of the TopoMap class of the client-side Java API (described in Topology Data Model Java Interface).

Examples

The following example adds an edge connecting node N3 to node N4 in the current updatable TopoMap object. (The example refers to definitions and data from Topology Built from Topology Data.)

CALL SDO_TOPO_MAP.ADD_EDGE(null, 3, 4,
  SDO_GEOMETRY(2002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1),
    SDO_ORDINATE_ARRAY(25,35, 20,37)))
  INTO :res_number;
 
Call completed.
 
SQL> PRINT res_number;
 
RES_NUMBER                                                                      
----------                                                                      
        29