4.3 SDO_TOPO_MAP.ADD_LINEAR_GEOMETRY

Format

SDO_TOPO_MAP.ADD_LINEAR_GEOMETRY(     
  topology IN VARCHAR2,      
  curve    IN SDO_GEOMETRY      
) RETURN SDO_NUMBER_ARRAY;

or

SDO_TOPO_MAP.ADD_LINEAR_GEOMETRY(     
  topology IN VARCHAR2,      
  coords   IN SDO_NUMBER_ARRAY      
) RETURN SDO_NUMBER_ARRAY;

Description

Adds a linear (line string or multiline string) geometry to the topology, inserting edges and nodes as necessary based on the full intersection of the geometry with the edges and nodes in the topology graph, and an array of the edge IDs of the inserted and shared edges in sequence from the start to the end of the geometry.

Parameters

topology

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

curve

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

coords

SDO_NUMBER_ARRAY object specifying the coordinates of the edge or edges to be added.

Usage Notes

This function creates at least one new edge, and more edges if necessary. For example, if the line string geometry intersects an existing edge, two edges are created for the added line string, and the existing edge (the one being intersected) is divided into two edges. If topology is not null, Spatial automatically updates the <topology-name>_EDGE$ table as needed. (If topology is null, you can update this table at any time by calling the SDO_TOPO_MAP.UPDATE_TOPO_MAP procedure.)

This function returns an array of the edge IDs of the inserted and shared edges in sequence from the start to the end of the geometry. If a segment in the added geometry overlaps an existing edge in the topology, the sign of the returned edge depends on the directions of the added segment and the existing edge: if the direction of the existing edge is the same as the linear geometry, the returned edge element is positive; if the direction of the existing edge is the opposite of the linear geometry, the returned edge element is negative.

An exception is raised if the object in the curve or coords parameter contains any line segments that run together (overlap) in any manner; however, the line segments can cross at one or more points.

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

This function is equivalent to using the addLinearGeometry 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 representing a specified line string geometry, 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.)

SELECT SDO_TOPO_MAP.ADD_LINEAR_GEOMETRY(null,
  SDO_GEOMETRY(2002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1,2,1),
    SDO_ORDINATE_ARRAY(50,10, 55,10, 57,11)))
FROM DUAL;
 
SDO_TOPO_MAP.ADD_LINEAR_GEOMETRY(NULL,SDO_GEOMETRY(2002,NULL,NULL,SDO_ELEM_INFO_
--------------------------------------------------------------------------------
SDO_NUMBER_ARRAY(31)