4.5 SDO_TOPO_MAP.ADD_NODE
Format
SDO_TOPO_MAP.ADD_NODE( topology IN VARCHAR2, edge_id IN NUMBER, point IN SDO_GEOMETRY, coord_index IN NUMBER, is_new_shape_point IN VARCHAR2 ) RETURN NUMBER;
or
SDO_TOPO_MAP.ADD_NODE( topology IN VARCHAR2, edge_id IN NUMBER, x IN NUMBER, y IN NUMBER, coord_index IN NUMBER, is_new_shape_point IN VARCHAR2 ) RETURN NUMBER;
Description
Adds a non-isolated node to a topology to split an existing edge, and returns the node ID of the added node.
Parameters
- topology
-
Name of the topology to which to add the node, or null if you are using an updatable TopoMap object (see Specifying the Editing Approach with the Topology Parameter). Must not exceed 20 characters.
- edge_id
-
Edge ID of the edge on which the node is to be added.
- point
-
SDO_GEOMETRY object (point geometry) representing the node to be added. The point must be an existing shape point or a new point that breaks a line segment connecting two consecutive shape points.
- x
-
X-axis value of the point representing the node to be added. The point must be an existing shape point or a new point that breaks a line segment connecting two consecutive shape points.
- y
-
Y-axis value of the point representing the node to be added. The point must be an existing shape point or a new point that breaks a line segment connecting two consecutive shape points.
- coord_index
-
The index (position) of the array position in the edge coordinate array on or after which the node is to be added. Each vertex (node or shape point) has a position in the edge coordinate array. The start point (node) is index (position) 0, the first point after the start point is 1, and so on. (However, the
coord_index
value cannot be the index of the last vertex.) For example, if the edge coordinates are (2,2, 5,2, 8,3) the index of the second vertex (5,2) is 1. - is_new_shape_point
-
TRUE
if the added node is to be a new shape point following the indexed vertex (coord_index
value) of the edge;FALSE
if the added node is exactly on the indexed vertex.A value of
TRUE
lets you add a node at a new point, breaking an edge segment at the coordinates specified in thepoint
parameter or thex
andy
parameter pair. A value ofFALSE
causes the coordinates in thepoint
parameter or thex
andy
parameter pair to be ignored, and causes the node to be added at the existing shape point associated with thecoord_index
value.
Usage Notes
Spatial automatically assigns a node ID to the added node and creates a new edge. The split piece at the beginning of the old edge is given the edge ID of the old edge. If topology
is not null, appropriate entries are inserted in the <topology-name>_NODE$ and <topology-name>_EDGE$ tables. (If topology
is null, you can update these tables at any time by calling the SDO_TOPO_MAP.UPDATE_TOPO_MAP procedure.)
To add an isolated node (that is, an island node), use the SDO_TOPO_MAP.ADD_ISOLATED_NODE function.
For information about adding and deleting nodes and edges, see Editing Topologies .
This function is equivalent to using the addNode
method of the TopoMap
class of the client-side Java API (described in Topology Data Model Java Interface).
Examples
The following example adds a non-isolated node to the right of node N2 on edge E2, and it returns the node ID of the added node. It uses the current updatable TopoMap object. (The example refers to definitions and data from Topology Built from Topology Data.)
DECLARE result_num NUMBER; BEGIN result_num := SDO_TOPO_MAP.ADD_NODE(null, 2, SDO_GEOMETRY(2001, NULL, SDO_POINT_TYPE(27,30,NULL), NULL, NULL), 0, 'TRUE'); DBMS_OUTPUT.PUT_LINE('Result = ' || result_num); END; / Result = 26 PL/SQL procedure successfully completed.
Parent topic: SDO_TOPO_MAP Package Subprograms