Performing Operations on Nodes

This topic contains sections that describe the effects of adding, moving, and removing nodes, and that explain how to perform these operations using the PL/SQL API.

Adding a Node

Adding a non-isolated node adds the node to an edge at a point that is currently on the edge. This operation also splits the edge, causing the original edge to be divided into two edges. Spatial automatically adjusts the definition of the original edge and creates a new edge (assigning it an ID value that is unique among edges in the topology).

To add a non-isolated node, use the SDO_TOPO_MAP.ADD_NODE function. To add an isolated node, use the SDO_TOPO_MAP.ADD_ISOLATED_NODE function.

Figure: Adding a Non-Isolated Node shows the addition of a node (N3) on edge E1.

Figure: Adding a Non-Isolated Node

Description of the illustration add_node.gif

As a result of the operation shown in Figure: Adding a Non-Isolated Node:

Figure: Effect of is_new_shape_point Value on Adding a Node shows a more complicated example of adding a node, where the result depends on whether or not the added node is a new shape point of the original edge (that is, on the value of the is_new_shape_point parameter to the SDO_TOPO_MAP.ADD_NODE function).

Figure: Effect of is_new_shape_point Value on Adding a Node

Description of the illustration add_node_2.gif

In Figure: Effect of is_new_shape_point Value on Adding a Node:

Moving a Node

Moving a non-isolated node to a new position causes the ends of all edges that are attached to the node to move with the node. You must specify the vertices for all edges affected by the moving of the node; each point (start or end) that is attached to the node must have the same coordinates as the new location of the node, and the other end points (not the moved node) of each affected edge must remain the same.

To move a non-isolated node, use the SDO_TOPO_MAP.MOVE_NODE procedure. To move an isolated node, use the SDO_TOPO_MAP.MOVE_ISOLATED_NODE procedure.

Figure: Topology Before Moving a Non-Isolated Node shows the original topology before node N1 is moved.

Figure: Topology Before Moving a Non-Isolated Node

Description of the illustration move_node_1.gif

Figure: Topology After Moving a Non-Isolated Node shows two cases of the original topology after node N1 is moved. In one case, no reshaping occurs; that is, all edges affected by the movement are specified as straight lines. In the other case, reshaping occurs; that is, one or more affected edges are specified as line segments with multiple vertices.

Figure: Topology After Moving a Non-Isolated Node

Description of the illustration move_node_2b.gif

In both cases shown in Figure: Topology After Moving a Non-Isolated Node:

Any isolated nodes and edges might remain in the same face or be moved to a different face as a result of a move operation on a non-isolated node. The SDO_TOPO_MAP.MOVE_NODE procedure has two output parameters, moved_iso_nodes and moved_iso_edges, that store the ID numbers of any isolated nodes and edges that were moved to a different face as a result of the operation.

A node cannot be moved if, as a result of the move, any of the following would happen:

Description of the illustration flip_node.gif

Additional Examples of Allowed and Disallowed Node Moves

This section provides additional examples of node movement operations that are either allowed or not allowed. All refer to the topology shown in Figure: Topology for Node Movement Examples.

Figure: Topology for Node Movement Examples

Description of the illustration node_moves_several.gif

In the topology shown in Figure: Topology for Node Movement Examples:

When the following node move operations are attempted using the topology shown in Figure: Topology for Node Movement Examples, the following results occur:

Removing a Node

You can remove individual nodes (isolated or non-isolated), as explained in this section, and you can remove all obsolete nodes in a topology, as explained in Removing Obsolete Nodes.

Removing a non-isolated node deletes the node and merges the edges that were attached to the node into a single edge. (Spatial applies complex rules, which are not documented, to determine the ID value and direction of the resulting edge.)

To remove a non-isolated or isolated node, use the SDO_TOPO_MAP.REMOVE_NODE procedure.

Figure: Removing a Non-Isolated Node shows the removal of a node (N1) that is attached to edges E1 and E2.

Figure: Removing a Non-Isolated Node

Description of the illustration delete_node.gif

As a result of the operation shown in Figure: Removing a Non-Isolated Node:

A node cannot be removed if one or more of the following are true:

Removing Obsolete Nodes

An obsolete node is a node that is connected to only two distinct edges, is not assigned to any point feature, and does not serve as the demarcation between different linear features. Obsolete nodes can result when the SDO_TOPO_MAP.ADD_POLYGON_GEOMETRY function is used repeatedly to build a topology, or when edges have been removed during editing operations, leaving some unnecessary nodes. Therefore, it is recommended that you use the SDO_TOPO_MAP.REMOVE_OBSOLETE_NODES procedure to remove obsolete nodes in such cases.

Spatial automatically updates the appropriate entries in the _NODE$ and _EDGE$ tables, and in the _FACE$ table if necessary.

Figure: Removing Obsolete Nodes shows the removal of obsolete nodes in a simple topology. In this topology, node N1 has a point feature named Art Museum defined on it, and node N3 has a point feature named Town Hall defined on it. Edges E1, E2, and E3 have a linear feature named Main Street defined on them, and edge E4 has a linear feature named First Avenue defined on it.

Figure: Removing Obsolete Nodes

Description of the illustration delete_obsolete_nodes.gif

In Figure: Removing Obsolete Nodes, the only node removed is N2, because only that node satisfies all the criteria for an obsolete node. As for the other nodes:

Also as a result of the operation shown in Figure: Removing Obsolete Nodes, edge E2 was removed as a result of the removal of node N2.