4.4 SDO_TOPO_MAP.ADD_LOOP

Format

SDO_TOPO_MAP.ADD_LOOP(     
  topology  IN VARCHAR2,      
  node_id   IN NUMBER,      
  geom      IN SDO_GEOMETRY      
) RETURN NUMBER;

Description

Adds an edge that loops and connects to the same node, 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_id

Node ID of the node to which to add the edge that will start and end at this node.

geom

SDO_GEOMETRY object (line string geometry) representing the edge to be added. The start and end points of the line string must be the same point representing node_id.

Usage Notes

This function creates a new edge, as well as a new face consisting of the interior of the loop. If the edge is added at an isolated node, the edge is an isolated edge. If topology is not null, Spatial automatically updates the <topology-name>_EDGE$ and <topology-name>_FACE$ tables as needed. (If topology is null, you can update these tables at any time by calling the SDO_TOPO_MAP.UPDATE_TOPO_MAP procedure.)

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

This function is equivalent to using the addLoop 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 loop starting and ending at node N4, and it returns the edge ID of the added edge. It uses the current updatable TopoMap object. (The example refers to definitions and data from Topology Built from Topology Data.)

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