The MDSYS.SDO_NET package contains subprograms (functions and procedures) for managing networks. To use the subprograms in this chapter, you must understand the conceptual information in Chapter 5.
For a listing of the subprograms grouped in logical categories, see Section 5.12.1. The rest of this chapter provides reference information about the subprograms, listed in alphabetical order.
SDO_NET.ADD_CHILD_FEATURE(
parent_layer_id IN NUMBER,
parent_feature_id IN NUMBER,
child_layer_id IN NUMBER,
child_feature_id IN SDO_NET_LAYER_FEAT,
sequence_number IN NUMBER DEFAULT NULL,
check_integrity IN BOOLEAN DEFAULT TRUE);
ID of the parent feature layer.
ID of the feature that is to become the parent feature of the specified child feature.
ID of the child feature layer.
ID of the feature to be associated as a child feature of the specified parent feature. (The SDO_NET_LAYER_FEAT type is described in Section 5.7.1.)
Sequence number of the child_feature_id
feature in the child feature layer. If this parameter is null, a sequence number after the last current number is assigned.
TRUE
(the default) checks if the child feature exists; and if it does not exist, an error is generated. FALSE
does not check if the child feature exists.
The specified child feature must already exist.
To associate multiple features as child features, use the SDO_NET.ADD_CHILD_FEATURES procedure.
The following example adds a child feature at sequence number 2.
DECLARE parent_layer_id NUMBER; parent_feature_id NUMBER := 1; child_layer_id NUMBER; child_feature_id NUMBER := 3; BEGIN parent_layer_id := sdo_net.get_feature_layer_id('GRID', 'PARENT_LAYER'); child_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); sdo_net.add_child_feature(parent_layer_id, parent_feature_id, child_layer_id, child_feature_id, 2, true); END; /
SDO_NET.ADD_CHILD_FEATURES(
parent_layer_id IN NUMBER,
parent_feature_id IN NUMBER,
child_feature_ids IN SDO_NET_LAYER_FEAT_ARRAY,
check_integrity IN BOOLEAN DEFAULT TRUE);
ID of the parent feature layer.
ID of the feature that is to become the parent feature of the specified child features.
IDs of features to be associated as child features of the specified parent feature. (The SDO_NET_LAYER_FEAT_ARRAY type is described in Section 5.7.1.)
TRUE
(the default) checks if the child features exist; and if any do not exist, an error is generated. FALSE
does not check if the child features exist.
The specified child features must already exist.
To associate a single feature as a child feature, use the SDO_NET.ADD_CHILD_FEATURE procedure.
The following example adds two child features at the end of the parent feature.
DECLARE parent_layer_id NUMBER; parent_feature_id NUMBER := 1; child_layer_id NUMBER; child_feature_ids SDO_NET_LAYER_FEAT_ARRAY := SDO_NET_LAYER_FEAT_ARRAY(); BEGIN parent_layer_id := sdo_net.get_feature_layer_id('GRID', 'PARENT_LAYER'); child_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); child_feature_ids.extend; child_feature_ids(1) := SDO_NET_LAYER_FEAT(child_layer_id, 4); child_feature_ids.extend; child_feature_ids(2) := SDO_NET_LAYER_FEAT(child_layer_id, 10); sdo_net.add_child_features(parent_layer_id, parent_feature_id, child_feature_ids, true); END; /
SDO_NET.ADD_FEATURE(
feature_layer_id IN NUMBER,
feature_id IN NUMBER,
feature_elements IN SDO_NET_FEAT_ELEM_ARRAY DEFAULT NULL,
child_feature_ids IN SDO_NET_LAYER_FEAT_ARRAY DEFAULT NULL,
check_integrity IN BOOLEAN DEFAULT TRUE);
ID of the feature layer to which to add the feature.
ID of the feature to be added to the feature layer.
Feature elements of the feature to be added. If this parameter is null, no feature elements are defined for this feature. (The SDO_NET_FEAT_ELEM_ARRAY type is described in Section 5.7.1.)
IDs of the child features of the feature that are to be added along with the feature. If this parameter is null, no child features are to be added. (The SDO_NET_LAYER_FEAT_ARRAY type is described in Section 5.7.1.)
TRUE
(the default) checks if the input network elements exist; and if any do not exist, an error is generated. FALSE
does not check if the input network elements exist.
To update a feature in a feature layer, use the SDO_NET.UPDATE_FEATURE procedure.
The following example adds a feature associated with a point at 20% on link 1314.
DECLARE feature_layer_id NUMBER; feature_id NUMBER := 1; elements SDO_NET_FEAT_ELEM_ARRAY := SDO_NET_FEAT_ELEM_ARRAY(); link_id NUMBER := 1314; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); elements.extend; elements(1) := SDO_NET_FEAT_ELEM(SDO_NET.FEAT_ELEM_TYPE_POL, link_id, 0.2, null); sdo_net.add_feature(feature_layer_id, feature_id, elements, null); END; /
SDO_NET.ADD_FEATURE_ELEMENT(
feature_layer_id IN NUMBER,
feature_id IN NUMBER,
feature_element IN SDO_NET_FEAT_ELEM,
sequence_number IN NUMBER DEFAULT NULL,
check_integrity IN BOOLEAN DEFAULT TRUE);
ID of the feature layer for the feature.
ID of the feature.
Feature element to be added to the feature. This feature element is automatically appended to the end of any existing feature elements in the feature. (The SDO_NET_FEAT_ELEM type is described in Section 5.7.1.)
Sequence number of the added feature element in the feature. If this parameter is null, a sequence number after the last current number is assigned.
TRUE
(the default) checks if the input network elements exist; and if any do not exist, an error is generated. FALSE
does not check if the input network elements exist.
To add multiple feature elements to a feature in a single operation, use the SDO_NET.ADD_FEATURE_ELEMENTS procedure.
To update a feature element, use the SDO_NET.UPDATE_FEATURE_ELEMENT procedure.
The following example adds a point feature for node ID 13 at sequence number 2.
DECLARE feature_layer_id NUMBER; feature_id NUMBER := 1; feature_element SDO_NET_FEAT_ELEM; node_id NUMBER := 13; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); feature_element := SDO_NET_FEAT_ELEM(SDO_NET.FEAT_ELEM_TYPE_PON, node_id, null, null); sdo_net.add_feature_element(feature_layer_id, feature_id, feature_element, 2); END; /
SDO_NET.ADD_FEATURE_ELEMENTS(
feature_layer_id IN NUMBER,
feature_id IN NUMBER,
feature_elements IN SDO_NET_FEAT_ELEM,_ARRAY,
check_integrity IN BOOLEAN DEFAULT TRUE);
ID of the feature layer for the feature.
ID of the feature.
Feature elements to be added to the feature. These feature elements are automatically appended to the end of any existing feature elements in the feature. (The SDO_NET_FEAT_ELEM_ARRAY type is described in Section 5.7.1.)
TRUE
(the default) checks if the input network elements exist; and if any do not exist, an error is generated. FALSE
does not check if the input network elements exist.
To add a single feature element to a feature, use the SDO_NET.ADD_FEATURE_ELEMENT procedure.
The following example adds two point feature elements at the end of the feature elements associated with feature ID 1.
DECLARE feature_layer_id NUMBER; feature_id NUMBER := 1; elements SDO_NET_FEAT_ELEM_ARRAY := SDO_NET_FEAT_ELEM_ARRAY(); link_id NUMBER := 1314; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); elements.extend; elements(1) := SDO_NET_FEAT_ELEM(SDO_NET.FEAT_ELEM_TYPE_POL, link_id, 0.7, null); elements.extend; elements(2) := SDO_NET_FEAT_ELEM(SDO_NET.FEAT_ELEM_TYPE_POL, link_id, 0.8, null); sdo_net.add_feature_elements(feature_layer_id, feature_id, elements); END; /
SDO_NET.ADD_FEATURE_LAYER(
network_name IN VARCHAR2,
feature_layer_name IN VARCHAR2,
feature_layer_type IN VARCHAR2,
feature_table IN VARCHAR2,
relation_table IN VARCHAR2,
hierarchy_table IN VARCHAR2);
Name of the network.
Name of the feature layer.
Type of features in the layer (from Table 5-1, "Feature Types").
Name of the feature table (see Section 5.10.2.1).
Name of the feature element relationships table (see Section 5.10.2.2).
Name of the feature hierarchy table (see Section 5.10.2.3).
SDO_NET.COMPUTE_PATH_GEOMETRY(
network IN VARCHAR2,
path_id IN NUMBER,
tolerance IN NUMBER
) RETURN SDO_GEOMETRY;
Network name.
Path ID number.
Tolerance value associated with geometries in the network. (Tolerance is explained in Chapter 1 of Oracle Spatial and Graph Developer's Guide.) This value should be consistent with the tolerance values of the geometries in the link table and node table for the network.
This function computes and returns the SDO_GEOMETRY object for the specified path.
This function and the SDO_NET_MEM.PATH.COMPUTE_GEOMETRY procedure (documented in Chapter 6) both compute a path geometry, but they have the following differences:
The SDO_NET.COMPUTE_PATH_GEOMETRY function computes the path from the links in the database, and does not use a network memory object. It returns the path geometry.
The SDO_NET_MEM.PATH.COMPUTE_GEOMETRY procedure computes the path using a network memory object that has been loaded. It does not return the path geometry; you must use the SDO_NET_MEM.PATH.GET_GEOMETRY function to get the geometry.
The following example computes and returns the spatial geometry of the path with path ID 1 in the network named SDO_NET1
, using a tolerance value of 0.005. The returned path geometry is a straight line from (1,1) to (15,1) because this path consists of a single link.
SELECT SDO_NET.COMPUTE_PATH_GEOMETRY('SDO_NET1', 1, 0.005) FROM DUAL; SDO_NET.COMPUTE_PATH_GEOMETRY('SDO_NET1',1,0.005)(SDO_GTYPE, SDO_SRID, SDO_POINT -------------------------------------------------------------------------------- SDO_GEOMETRY(2002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 1, 1, 15, 1))
SDO_NET.COPY_NETWORK(
source_network IN VARCHAR2,
target_network IN VARCHAR2,
storage_parameters IN VARCHAR2 DEFAULT NULL);
Name of the network to be copied.
Name of the network to be created as a copy of source_network
.
Physical storage parameters used internally to create network tables. Must be a valid string for use with the CREATE TABLE statement. For example: TABLESPACE tbs_3 STORAGE (INITIAL 100K NEXT 200K)
. If you do not specify this parameter, the default physical storage values are used.
This procedure creates an entry in the xxx_SDO_NETWORK_METADATA views (described in Section 5.11.1) for target_network
that has the same information as for source_network
, except for the new network name.
This procedure also creates a new node table, link table, and path table (if a path table exists for source_network
) for target_network
based on the metadata and data in these tables for source_network
. These tables have names in the form <target-network>_NODE$, <target-network>_LINK$, and <target-network>_PATH$. For example, if target_network
has the value ROADS_NETWORK2
and if source_network
has a path table, the names of the created metadata tables are ROADS_NETWORK2_NODE$, ROADS_NETWORK2_LINK$, and ROADS_NETWORK2_PATH$.
SDO_NET.CREATE_LINK_TABLE(
table_name IN VARCHAR2,
geom_type IN VARCHAR2,
geom_column IN VARCHAR2,
cost_column IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
add_bidirected_column IN BOOLEAN DEFALT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
Name of the link table.
For a spatial network, specify a value indicating the geometry type of links: SDO_GEOMETRY
for non-LRS SDO_GEOMETRY objects, LRS_GEOMETRY
for LRS SDO_GEOMETRY objects, or TOPO_GEOMETRY
for SDO_TOPO_GEOMETRY objects.
For a spatial network, the name of the column containing the geometry objects associated with the links. (If the geom_type
value is not spelled correctly, the geom_column
column is not included in the table.)
Name of the column containing the cost values to be associated with the links.
Number of hierarchy levels for links in the network. (For an explanation of network hierarchy, see Section 5.5.)
TRUE
adds a column named BIDIRECTED to the link table; FALSE
(the default) does not add a column named BIDIRECTED to the link table.
Physical storage parameters used internally to create the link table. Must be a valid string for use with the CREATE TABLE statement. For example: TABLESPACE tbs_3 STORAGE (INITIAL 100K NEXT 200K)
. If you do not specify this parameter, the default physical storage values are used.
The link table is described in Section 5.10.1.2.
SDO_NET.CREATE_LOGICAL_NETWORK(
network IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
is_directed IN BOOLEAN,
node_with_cost IN BOOLEAN DEFAULT FALSE,
is_complex IN BOOLEAN DEFAULT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
or
SDO_NET.CREATE_LOGICAL_NETWORK(
network IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
is_directed IN BOOLEAN,
node_table_name IN VARCHAR2,
node_cost_column IN VARCHAR2,
link_table_name IN VARCHAR2,
link_cost_column IN VARCHAR2,
path_table_name IN VARCHAR2,
path_link_table_name IN VARCHAR2,
subpath_table_name IN VARCHAR2,
is_complex IN BOOLEAN DEFAULT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
Creates a logical network, creates all necessary tables, and updates the network metadata.
Network name.
Number of hierarchy levels for links in the network. (For an explanation of network hierarchy, see Section 5.5.)
A Boolean value. TRUE
indicates that the links are directed; FALSE
indicates that the links are undirected (not directed).
A Boolean value. TRUE
causes a column named COST to be included in the <network-name>_NODE$ table; FALSE
(the default) causes a column named COST not to be included in the <network-name>_NODE$ table.
Name of the node table to be created. (The node table is explained in Section 5.10.1.1.) If you use the format that does not specify this parameter, a node table named <network-name>_NODE$ is created.
Name of the cost column in the node table. (The node table is explained in Section 5.10.1.1.) If you use the format that does not specify this parameter, the geometry column is named COST.
Name of the link table to be created. (The link table is explained in Section 5.10.1.2.) If you use the format that does not specify this parameter, a link table named <network-name>_LINK$ is created.
Name of the cost column in the link table. (The link table is explained in Section 5.10.1.2.) If you use the format that does not specify this parameter, the geometry column is named COST.
Name of the path table to be created. (The path table is explained in Section 5.10.1.3.) If you use the format that does not specify this parameter, a path table named <network-name>_PATH$ is created.
Name of the path-link table to be created. (The path-link table is explained in Section 5.10.1.4.) If you use the format that does not specify this parameter, a path-link table named <network-name>_PLINK$ is created.
Name of the subpath table to be created. (The subpath table is explained in Section 5.10.1.5.)
Reserved for future use. Ignored for the current release.
Physical storage parameters used internally to create network tables. Must be a valid string for use with the CREATE TABLE statement. For example: TABLESPACE tbs_3 STORAGE (INITIAL 100K NEXT 200K)
. If you do not specify this parameter, the default physical storage values are used.
This procedure provides a convenient way to create a logical network when the node, link, and optional related tables do not already exist. The procedure creates the network; creates the node, link, path, and path-link tables for the network; and inserts the appropriate information in the xxx_SDO_NETWORK_METADATA views (described in Section 5.11.1).
An exception is generated if any of the tables to be created already exists.
The procedure has two formats. The simpler format creates the tables using default values for the table name and the cost column name. The other format lets you specify names for the tables and the cost column.
As an alternative to using this procedure, you can create the network as follows: create the tables using the SDO_NET.CREATE_NODE_TABLE, SDO_NET.CREATE_LINK_TABLE, SDO_NET.CREATE_PATH_TABLE, and SDO_NET.CREATE_PATH_LINK_TABLE procedures; and insert the appropriate row in the USER_SDO_NETWORK_METADATA view.
The following example creates a directed logical network named LOG_NET1
. The example creates the LOG_NET1_NODE$, LOG_NET1_LINK$,LOG_NET1_PATH$, and LOG_NET1_PLINK$ tables, and updates the xxx_SDO_NETWORK_METADATA views. Both the node and link tables contain a cost column named COST.
EXECUTE SDO_NET.CREATE_LOGICAL_NETWORK('LOG_NET1', 1, TRUE, TRUE);
SDO_NET.CREATE_LRS_NETWORK(
network IN VARCHAR2,
lrs_table_name IN VARCHAR2,
lrs_geom_column IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
is_directed IN BOOLEAN,
node_with_cost IN BOOLEAN DEFAULT FALSE,
is_complex IN BOOLEAN DEFAULT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
or
SDO_NET.CREATE_LRS_NETWORK(
network IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
is_directed IN BOOLEAN,
node_table_name IN VARCHAR2,
node_cost_column IN VARCHAR2,
link_table_name IN VARCHAR2,
link_cost_column IN VARCHAR2,
lrs_table_name IN VARCHAR2,
lrs_geom_column IN VARCHAR2,
path_table_name IN VARCHAR2,
path_geom_column IN VARCHAR2,
path_link_table_name IN VARCHAR2,
subpath_table_name IN VARCHAR2,
subpath_geom_column IN VARCHAR2,
is_complex IN BOOLEAN DEFAULT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
Creates a spatial network containing LRS SDO_GEOMETRY objects, creates all necessary tables, and updates the network metadata.
Network name.
Name of the table containing the LRS geometry column.
Name of the column in lrs_table_name
that contains LRS geometries (that is, SDO_GEOMETRY objects that include measure information for linear referencing).
A Boolean value. TRUE
indicates that the links are directed; FALSE
indicates that the links are undirected (not directed).
Number of hierarchy levels for links in the network. (For an explanation of network hierarchy, see Section 5.5.)
A Boolean value. TRUE
causes a column named COST to be included in the <network-name>_NODE$ table; FALSE
(the default) causes a column named COST not to be included in the <network-name>_NODE$ table.
Reserved for future use. Ignored for the current release.
Name of the node table to be created. (The node table is explained in Section 5.10.1.1.) If you use the format that does not specify this parameter, a node table named <network-name>_NODE$ is created.
Name of the cost column in the node table. (The node table is explained in Section 5.10.1.1.) If you use the format that does not specify this parameter, the geometry column is named COST.
Name of the link table to be created. (The link table is explained in Section 5.10.1.2.) If you use the format that does not specify this parameter, a link table named <network-name>_LINK$ is created.
Name of the cost column in the link table. (The link table is explained in Section 5.10.1.2.) If you use the format that does not specify this parameter, the geometry column is named COST.
Name of the path table to be created. (The path table is explained in Section 5.10.1.3.) If you use the format that does not specify this parameter, a path table named <network-name>_PATH$ is created.
Name of the geometry column in the path table. (The path table is explained in Section 5.10.1.3.) If you use the format that does not specify this parameter, the geometry column is named GEOMETRY.
Name of the path-link table to be created. (The path-link table is explained in Section 5.10.1.4.) If you use the format that does not specify this parameter, a path-link table named <network-name>_PLINK$ is created.
Name of the subpath table to be created. (The subpath table is explained in Section 5.10.1.5.).
Name of the geometry column in the subpath table. (The subpath table is explained in Section 5.10.1.5.)
Physical storage parameters used internally to create network tables. Must be a valid string for use with the CREATE TABLE statement. For example: TABLESPACE tbs_3 STORAGE (INITIAL 100K NEXT 200K)
. If you do not specify this parameter, the default physical storage values are used.
This procedure provides a convenient way to create a spatial network of LRS geometries when the node, link, and optional related tables do not already exist. The procedure creates the network; creates the node, link, path, and path-link tables for the network; and inserts the appropriate information in the xxx_SDO_NETWORK_METADATA views (described in Section 5.11.1).
An exception is generated if any of the tables to be created already exists.
The procedure has two formats. The simpler format creates the tables using default values for the table name and the geometry and cost column names. The other format lets you specify names for the tables and the geometry and cost columns.
As an alternative to using this procedure, you can create the network as follows: create the tables using the SDO_NET.CREATE_NODE_TABLE, SDO_NET.CREATE_LINK_TABLE, SDO_NET.CREATE_PATH_TABLE, and SDO_NET.CREATE_PATH_LINK_TABLE procedures; and insert the appropriate row in the USER_SDO_NETWORK_METADATA view.
The following example creates a directed spatial network named LRS_NET1
. The LRS geometries are in the column named LRS_GEOM in the table named LRS_TAB. The example creates the LRS_NET1_NODE$, LRS_NET1_LINK$, LRS_NET1_PATH$, and LRS_NET1_PLINK$ tables, and updates the xxx_SDO_NETWORK_METADATA views. All geometry columns are named GEOMETRY. Both the node and link tables contain a cost column named COST.
EXECUTE SDO_NET.CREATE_LRS_NETWORK('LRS_NET1', 'LRS_TAB', 'LRS_GEOM', 1, TRUE, TRUE);
SDO_NET.CREATE_LRS_TABLE(
table_name IN VARCHAR2,
geom_column IN VARCHAR2,
storage_parameters IN VARCHAR2 DEFAULT NULL);
Creates a table for storing Oracle Spatial and Graph linear referencing system (LRS) geometries.
Name of the table containing the geometry column specified in geom_column
.
Name of the column (of type SDO_GEOMETRY) to contain geometry objects.
Physical storage parameters used internally to create the LRS table. Must be a valid string for use with the CREATE TABLE statement. For example: TABLESPACE tbs_3 STORAGE (INITIAL 100K NEXT 200K)
. If you do not specify this parameter, the default physical storage values are used.
This procedure creates a table named table_name
with two columns: GEOM_ID of type NUMBER and geom_column
of type SDO_GEOMETRY.
Although the created table does not need to be used to store LRS geometries, the procedure is intended as a convenient method for creating a table to store such geometries. You will probably want to modify the table to add other columns before you store data in the table.
The following example creates a table named HIGHWAYS with a geometry column named GEOM.
EXECUTE SDO_NET.CREATE_LRS_TABLE('HIGHWAYS', 'GEOM'); PL/SQL procedure successfully completed. DESCRIBE highways Name Null? Type ----------------------------------------- -------- ---------------------------- GEOM_ID NOT NULL NUMBER GEOM MDSYS.SDO_GEOMETRY
SDO_NET.CREATE_NODE_TABLE(
table_name IN VARCHAR2,
geom_type IN VARCHAR2,
geom_column IN VARCHAR2,
cost_column IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
is_complex IN BOOLEAN DEFAULT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
or
SDO_NET.CREATE_NODE_TABLE(
table_name IN VARCHAR2,
geom_type IN VARCHAR2,
geom_column IN VARCHAR2,
cost_column IN VARCHAR2,
partition_column IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
is_complex IN BOOLEAN DEFAULT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
Name of the node table.
For a spatial network, specify a value indicating the geometry type of nodes: SDO_GEOMETRY
for non-LRS SDO_GEOMETRY objects, LRS_GEOMETRY
for LRS SDO_GEOMETRY objects, or TOPO_GEOMETRY
for SDO_TOPO_GEOMETRY objects. (If the geom_type
value is not spelled correctly, the geom_column
column is not included in the table.)
For a spatial network, the name of the column containing the geometry objects associated with the nodes.
Name of the column containing the cost values to be associated with the nodes.
Name of the column containing the partition ID values to be associated with the nodes.
Number of hierarchy levels for nodes in the network. (For an explanation of network hierarchy, see Section 5.5.)
Reserved for future use. Ignored for the current release.
Physical storage parameters used internally to create the <network-name>_NODE$ table (described in Section 5.10.1.1). Must be a valid string for use with the CREATE TABLE statement. For example: TABLESPACE tbs_3 STORAGE (INITIAL 100K NEXT 200K)
. If you do not specify this parameter, the default physical storage values are used.
This procedure has two formats, one without the partition_column
parameter and one with the partition_column
parameter.
The node table is described in Section 5.10.1.1.
The partition table is described in Section 5.10.1.6.
For information about using partitioned networks to perform analysis using the load on demand approach, see Section 5.9.
SDO_NET.CREATE_PATH_LINK_TABLE(
table_name IN VARCHAR2,
storage_parameters IN VARCHAR2 DEFAULT NULL);
Creates a path-link table, that is, a table with a row for each link in each path in the path table.
Name of the path-link table.
Physical storage parameters used internally to create the path-link table. Must be a valid string for use with the CREATE TABLE statement. For example: TABLESPACE tbs_3 STORAGE (INITIAL 100K NEXT 200K)
. If you do not specify this parameter, the default physical storage values are used.
The path-link table is described in Section 5.10.1.4.
To use paths with a network, you must populate the path-link table.
SDO_NET.CREATE_PATH_TABLE(
table_name IN VARCHAR2,
geom_column IN VARCHAR2,
storage_parameters IN VARCHAR2 DEFAULT NULL);
Name of the path table.
For a spatial network, name of the column containing the geometry objects associated with the paths.
Physical storage parameters used internally to create the path table. Must be a valid string for use with the CREATE TABLE statement. For example: TABLESPACE tbs_3 STORAGE (INITIAL 100K NEXT 200K)
. If you do not specify this parameter, the default physical storage values are used.
The path table is described in Section 5.10.1.3.
To use paths with a network, after you create the path table, you must create the path-link table using the SDO_NET.CREATE_PATH_LINK_TABLE procedure, and populate the path-link table.
SDO_NET.CREATE_SDO_NETWORK(
network IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
is_directed IN BOOLEAN,
node_with_cost IN BOOLEAN DEFAULT FALSE,
is_complex IN BOOLEAN DEFAULT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
or
SDO_NET.CREATE_SDO_NETWORK(
network IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
is_directed IN BOOLEAN,
node_table_name IN VARCHAR2,
node_geom_column IN VARCHAR2,
node_cost_column IN VARCHAR2,
link_table_name IN VARCHAR2,
link_geom_column IN VARCHAR2,
link_cost_column IN VARCHAR2,
path_table_name IN VARCHAR2,
path_geom_column IN VARCHAR2,
path_link_table_name IN VARCHAR2,
subpath_table_name IN VARCHAR2,
subpath_geom_column IN VARCHAR2,
is_complex IN BOOLEAN DEFAULT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
Creates a spatial network containing non-LRS SDO_GEOMETRY objects, creates all necessary tables, and updates the network metadata.
Network name.
Number of hierarchy levels for links in the network. (For an explanation of network hierarchy, see Section 5.5.)
A Boolean value. TRUE
indicates that the links are directed; FALSE
indicates that the links are undirected (not directed).
A Boolean value. TRUE
causes a column named COST to be included in the <network-name>_NODE$ table; FALSE
(the default) causes a column named COST not to be included in the <network-name>_NODE$ table.
Name of the node table to be created. (The node table is explained in Section 5.10.1.1.) If you use the format that does not specify this parameter, a node table named <network-name>_NODE$ is created.
Name of the geometry column in the node table. (The node table is explained in Section 5.10.1.1.) If you use the format that does not specify this parameter, the geometry column is named GEOMETRY.
Name of the cost column in the node table. (The node table is explained in Section 5.10.1.1.) If you use the format that does not specify this parameter, the geometry column is named COST.
Name of the link table to be created. (The link table is explained in Section 5.10.1.2.) If you use the format that does not specify this parameter, a link table named <network-name>_LINK$ is created.
Name of the geometry column in the link table. (The link table is explained in Section 5.10.1.2.) If you use the format that does not specify this parameter, the geometry column is named GEOMETRY.
Name of the cost column in the link table. (The link table is explained in Section 5.10.1.2.) If you use the format that does not specify this parameter, the geometry column is named COST.
Name of the path table to be created. (The path table is explained in Section 5.10.1.3.) If you use the format that does not specify this parameter, a path table named <network-name>_PATH$ is created.
Name of the geometry column in the path table. (The path table is explained in Section 5.10.1.3.) If you use the format that does not specify this parameter, the geometry column is named GEOMETRY.
Name of the path-link table to be created. (The path-link table is explained in Section 5.10.1.4.) If you use the format that does not specify this parameter, a path-link table named <network-name>_PLINK$ is created.
Name of the subpath table to be created. (The subpath table is explained in Section 5.10.1.5.)
Name of the geometry column in the subpath table. (The subpath table is explained in Section 5.10.1.5.).
Reserved for future use. Ignored for the current release.
Physical storage parameters used internally to create network tables. Must be a valid string for use with the CREATE TABLE statement. For example: TABLESPACE tbs_3 STORAGE (INITIAL 100K NEXT 200K)
. If you do not specify this parameter, the default physical storage values are used.
This procedure provides a convenient way to create a spatial network when the node, link, and optional related tables do not already exist. The procedure creates the network; creates the node, link, path, and path-link tables for the network; and inserts the appropriate information in the xxx_SDO_NETWORK_METADATA views (described in Section 5.11.1).
An exception is generated if any of the tables to be created already exists.
The procedure has two formats. The simpler format creates the tables using default values for the table name and the geometry and cost column names. The other format lets you specify names for the tables and the geometry and cost columns.
As an alternative to using this procedure, you can create the network as follows: create the tables using the SDO_NET.CREATE_NODE_TABLE, SDO_NET.CREATE_LINK_TABLE, SDO_NET.CREATE_PATH_TABLE, and SDO_NET.CREATE_PATH_LINK_TABLE procedures; and insert the appropriate row in the USER_SDO_NETWORK_METADATA view.
The following example creates a directed spatial network named SDO_NET1
. The example creates the SDO_NET1_NODE$, SDO_NET1_LINK$, SDO_NET1_PATH$, and SDO_NET1_PLINK$ tables, and updates the xxx_SDO_NETWORK_METADATA views. All geometry columns are named GEOMETRY. Both the node and link tables contain a cost column named COST.
EXECUTE SDO_NET.CREATE_SDO_NETWORK('SDO_NET1', 1, TRUE, TRUE);
SDO_NET.CREATE_PATH_TABLE(
table_name IN VARCHAR2,
geom_column IN VARCHAR2,
storage_parameters IN VARCHAR2 DEFAULT NULL);
Name of the subpath table.
For a spatial network, name of the column containing the geometry objects associated with the subpaths.
Physical storage parameters used internally to create the subpath table (described in Section 5.10.1.1). Must be a valid string for use with the CREATE TABLE statement. For example: TABLESPACE tbs_3 STORAGE (INITIAL 100K NEXT 200K)
. If you do not specify this parameter, the default physical storage values are used.
The subpath table is described in Section 5.10.1.5.
To use subpaths with a network, you must create one or more path tables and their associated path-link tables.
SDO_NET.CREATE_TOPO_NETWORK(
network IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
is_directed IN BOOLEAN,
node_with_cost IN BOOLEAN DEFAULT FALSE,
is_complex IN BOOLEAN DEFAULT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
or
SDO_NET.CREATE_TOPO_NETWORK(
network IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
is_directed IN BOOLEAN,
node_table_name IN VARCHAR2,
node_cost_column IN VARCHAR2,
link_table_name IN VARCHAR2,
link_cost_column IN VARCHAR2,
path_table_name IN VARCHAR2,
path_geom_column IN VARCHAR2,
path_link_table_name IN VARCHAR2,
is_complex IN BOOLEAN DEFAULT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
or
SDO_NET.CREATE_TOPO_NETWORK(
network IN VARCHAR2,
no_of_hierarchy_levels IN NUMBER,
is_directed IN BOOLEAN,
node_table_name IN VARCHAR2,
node_geom_column IN VARCHAR2,
node_cost_column IN VARCHAR2,
link_table_name IN VARCHAR2,
link_cost_column IN VARCHAR2,
path_table_name IN VARCHAR2,
path_geom_column IN VARCHAR2,
path_link_table_name IN VARCHAR2,
subpath_table_name IN VARCHAR2,
subpath_geom_column IN VARCHAR2,
is_complex IN BOOLEAN DEFAULT FALSE,
storage_parameters IN VARCHAR2 DEFAULT NULL);
Creates a spatial topology network containing SDO_TOPO_GEOMETRY objects, creates all necessary tables, and updates the network metadata.
Network name.
Number of hierarchy levels for links in the network. (For an explanation of network hierarchy, see Section 5.5.)
A Boolean value. TRUE
indicates that the links are directed; FALSE
indicates that the links are undirected (not directed).
A Boolean value. TRUE
causes a column named COST to be included in the <network-name>_NODE$ table; FALSE
(the default) causes a column named COST not to be included in the <network-name>_NODE$ table.
Name of the node table to be created. (The node table is explained in Section 5.10.1.1.) If you use the format that does not specify this parameter, a node table named <network-name>_NODE$ is created.
Name of the cost column in the node table. (The node table is explained in Section 5.10.1.1.) If you use the format that does not specify this parameter, the geometry column is named COST.
Name of the link table to be created. (The link table is explained in Section 5.10.1.2.) If you use the format that does not specify this parameter, a link table named <network-name>_LINK$ is created.
Name of the cost column in the link table. (The link table is explained in Section 5.10.1.2.) If you use the format that does not specify this parameter, the geometry column is named COST.
Name of the path table to be created. (The path table is explained in Section 5.10.1.3.) If you use the format that does not specify this parameter, a path table named <network-name>_PATH$ is created.
Name of the geometry column in the path table. (The path table is explained in Section 5.10.1.3.) If you use the format that does not specify this parameter, the geometry column is named GEOMETRY.
Name of the path-link table to be created. (The path-link table is explained in Section 5.10.1.4.) If you use the format that does not specify this parameter, a path-link table named <network-name>_PLINK$ is created.
Name of the subpath table to be created. (The subpath table is explained in Section 5.10.1.5.).
Name of the geometry column in the subpath table. (The subpath table is explained in Section 5.10.1.5.)
Reserved for future use. Ignored for the current release.
Physical storage parameters used internally to create network tables. Must be a valid string for use with the CREATE TABLE statement. For example: TABLESPACE tbs_3 STORAGE (INITIAL 100K NEXT 200K)
. If you do not specify this parameter, the default physical storage values are used.
This procedure provides a convenient way to create a spatial network when the node, link, and optional related tables do not already exist. The procedure creates the network; creates the node, link, path, and path-link tables for the network; and inserts the appropriate information in the xxx_SDO_NETWORK_METADATA views (described in Section 5.11.1). The node and link tables contain a topology geometry column named TOPO_GEOMETRY of type SDO_TOPO_GEOMETRY.
An exception is generated if any of the tables to be created already exists.
The procedure has two formats. The simpler format creates the tables using default values for the table name and the geometry and cost column names. The other format lets you specify names for the tables and the geometry and cost columns.
As an alternative to using this procedure, you can create the network as follows: create the tables using the SDO_NET.CREATE_NODE_TABLE, SDO_NET.CREATE_LINK_TABLE, SDO_NET.CREATE_PATH_TABLE, and SDO_NET.CREATE_PATH_LINK_TABLE procedures; and insert the appropriate row in the USER_SDO_NETWORK_METADATA view.
The following example creates a directed spatial topology geometry network named TOPO_NET1
. The example creates the TOPO_NET1_NODE$, TOPO_NET1_LINK$, TOPO_NET1_PATH$, and TOPO_NET1_PLINK$ tables, and updates the xxx_SDO_NETWORK_METADATA views. The topology geometry columns are named TOPO_GEOMETRY. Both the node and link tables contain a cost column named COST.
EXECUTE SDO_NET.CREATE_TOPO_NETWORK('TOPO_NET1', 1, TRUE, TRUE);
SDO_NET.DELETE_CHILD_FEATURES(
parent_layer_id IN NUMBER,
parent_feature_id IN NUMBER,
child_feature_ids IN SDO_NET_LAYER_FEAT_ARRAY);
ID of the parent feature layer.
ID of the parent feature of the specified child features.
IDs of the child features. (The SDO_NET_LAYER_FEAT_ARRAY type is described in Section 5.7.1.)
The specified parent and child features must exist.
To delete the child features at specified sequence points, use the SDO_NET.DELETE_CHILD_FEATURES_AT procedure.
The following example deletes a child feature with feature ID 1 in the POI
feature layer.
DECLARE parent_layer_id NUMBER; parent_feature_id NUMBER := 1; child_layer_id NUMBER; child_feature_ids SDO_NET_LAYER_FEAT_ARRAY := SDO_NET_LAYER_FEAT_ARRAY(); BEGIN parent_layer_id := sdo_net.get_feature_layer_id('GRID', 'PARENT_LAYER'); child_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); child_feature_ids.extend; child_feature_ids(1) := SDO_NET_LAYER_FEAT(child_layer_id, 1); sdo_net.delete_child_features(parent_layer_id, parent_feature_id, child_feature_ids); END; /
SDO_NET.DELETE_CHILD_FEATURES_AT(
parent_layer_id IN NUMBER,
parent_feature_id IN NUMBER,
sequence_numbers IN SDO_NUMBER_ARRAY);
Removes the parent-child relationship for the child features at the specified sequence numbers.
ID of the parent feature layer.
ID of the parent feature of the specified child features.
IDs of the child features. (The SDO_NET_LAYER_FEAT_ARRAY type is described in Section 5.7.1.)
The specified parent and child features must exist.
To delete child features specified by their ID values, use the SDO_NET.DELETE_CHILD_FEATURES procedure.
The following example deletes a child feature at sequence number 1.
DECLARE parent_layer_id NUMBER; parent_feature_id NUMBER := 1; sequence_numbers SDO_NUMBER_ARRAY := SDO_NUMBER_ARRAY(1); BEGIN parent_layer_id := sdo_net.get_feature_layer_id('GRID', 'PARENT_LAYER'); sdo_net.delete_child_features_at(parent_layer_id, parent_feature_id, sequence_numbers); END; /
Deletes dangling features in a feature layer. A dangling feature is a feature that is not associated with any network elements (nodes or links).
To find the dangling features in a feature layer, use the SDO_NET.GET_DANGLING_FEATURES function.
To find the dangling links in a network, use the SDO_NET.GET_DANGLING_LINKS function.
To find the dangling nodes in a network, use the SDO_NET.GET_DANGLING_NODES function.
SDO_NET.DELETE_FEATURE_ELEMENTS(
feature_layer_id IN NUMBER,
feature_id IN NUMBER,
feature_elements IN SDO_NET_FEAT_ELEM_ARRAY,
delete_net_elems IN BOOLEAN DEFAULT FALSE);
ID of the feature layer containing the feature.
ID of the feature from which to delete the feature elements.
Feature elements to be deleted. (The SDO_NET_FEAT_ELEM_ARRAY type is described in Section 5.7.1.)
Controls whether all network elements that are referenced only by the specified features are also deleted: TRUE
also deletes such elements; FALSE
(the default) does not also delete such elements.
Contrast this procedure with SDO_NET.DELETE_FEATURE_ELEMENTS_AT.
The following example two point feature elements from a specified feature layer.
DECLARE feature_layer_id NUMBER; feature_id NUMBER := 1; elements SDO_NET_FEAT_ELEM_ARRAY := SDO_NET_FEAT_ELEM_ARRAY(); link_id NUMBER := 1314; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); elements.extend; elements(1) := SDO_NET_FEAT_ELEM(SDO_NET.FEAT_ELEM_TYPE_POL, link_id, 0.2, null); elements.extend; elements(2) := SDO_NET_FEAT_ELEM(SDO_NET.FEAT_ELEM_TYPE_POL, link_id, 0.7, null); sdo_net.delete_feature_elements(feature_layer_id, feature_id, elements); END; /
SDO_NET.DELETE_FEATURE_ELEMENTS_AT(
feature_layer_id IN NUMBER,
feature_id IN NUMBER,
sequence_numbers IN SDO_NUMBER_ARRAY,
delete_net_elems IN BOOLEAN DEFAULT FALSE);
ID of the feature layer containing the feature.
ID of the feature from which to delete the feature elements.
Array of sequence numbers for the feature elements to be deleted.
Controls whether all network elements that are referenced only by the specified features are also deleted: TRUE
also deletes such elements; FALSE
(the default) does not also delete such elements.
Contrast this procedure with SDO_NET.DELETE_FEATURE_ELEMENTS
The following example deletes the feature element at sequence number 1.
DECLARE feature_layer_id NUMBER; feature_id NUMBER := 1; sequence_numbers SDO_NUMBER_ARRAY := SDO_NUMBER_ARRAY(); BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); sequence_numbers.extend; sequence_numbers(1) := 1; sdo_net.delete_feature_elements_at(feature_layer_id, feature_id, sequence_numbers); END; /
SDO_NET.DELETE_FEATURES(
feature_layer_id IN NUMBER,
feature_ids IN SDO_NUMBER_ARRAY,
delete_net_elems IN BOOLEAN DEFAULT FALSE,
delete_children IN BOOLEAN DEFAULT FALSE);
ID of the feature layer containing the features
IDs of the features to be deleted.
Controls whether all network elements that are referenced only by the specified features are also deleted: TRUE
also deletes such elements; FALSE
(the default) does not also delete such elements.
Controls whether all child features that are referenced only by the specified features are also deleted: TRUE
also deletes such features; FALSE
(the default) does not also delete such features.
The following example deletes the feature with feature ID 1 from the POI
feature layer in the GRID
network.
DECLARE feature_layer_id NUMBER; feature_ids SDO_NUMBER_ARRAY := SDO_NUMBER_ARRAY(1); BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); sdo_net.delete_features(feature_layer_id, feature_ids, false, false); END; /
Deletes a link, along with all dependent network elements and all references to the link from features.
This procedure deletes the specified link from the link table (described in Section 5.10.1.2), and it deletes any other network elements that depend on this link. For example, if the specified link is included in any paths and subpaths, those paths and subpaths are deleted also.
Deletes a node, along with all dependent network elements and all references to the node from features.
This procedure deletes the specified node from the node table (described in Section 5.10.1.1), and it deletes any other network elements that depend on this node. For example, if the specified node is included in any link definitions, those links are deleted; and if any of the deleted links are included in any paths and subpaths, those paths and subpaths are deleted also.
This procedure deletes the specified path from the path table (described in Section 5.10.1.3), and it deletes any other network elements that depend on this path. For example, if the specified path has any subpaths, those subpaths are deleted also.
Deletes phantom features in a feature layer. A phantom feature is a feature that references nonexistent network elements (nodes or links).
To find the phantom features in a feature layer, use the SDO_NET.GET_PHANTOM_FEATURES function.
This procedure deletes the specified subpath from the path table (described in Section 5.10.1.3). It does not delete any other network elements, because no other elements depend on a subpath definition.
Unloads (removes) the class for the specified network constraint from the Java repository in the database, and deletes the row for that constraint from the USER_SDO_NETWORK_CONSTRAINTS view (described in Section 5.11.2).
Name of the network constraint. Must match a value in the CONSTRAINT column of the USER_SDO_NETWORK_CONSTRAINTS view.
Use this procedure if you want to disable a network constraint that you had previously enabled, such as by using the SDO_NET.REGISTER_CONSTRAINTprocedure. For more information about network constraints, see Section 5.8.
SDO_NET.DROP_FEATURE_LAYER(
network_name IN VARCHAR2,
feature_layer_name IN VARCHAR2,
drop_tables IN BOOLEAN DEFAULT FALSE);
Name of the network containing the feature layer to be dropped.
Name of the feature layer to be dropped.
Controls whether all relevant tables are deleted along with the feature layer metadata: TRUE
drops the feature table, feature element relationships table, and feature hierarchy table, and deletes the feature layer metadata; FALSE
(the default) deletes the feature layer metadata but does not drop the feature table, feature element relationships table, and feature hierarchy table.
The following example drops the POI
feature layer in the GRID
network, and (because drop_tables
is true
) drops the feature table, feature element relationships table, and feature hierarchy table, and deletes the feature layer metadata
EXECUTE sdo_net.drop_feature_layer('GRID', 'POI', true);
This procedure also deletes the node, link, and path tables associated with the network, and the network metadata for the network.
SDO_NET.FIND_CONNECTED_COMPONENTS(
network IN VARCHAR2,
link_level IN NUMBER DEFAULT 1,
component_table_name IN VARCHAR2,
log_loc IN VARCHAR2,
log_file IN VARCHAR2,
open_mode IN VARCHAR2 DEFAULT 'A');
Finds all connected components for a specified link level in a network, and stores the information in the connected component table.
Network name.
Link level for which to find connected components (default = 1). The link level reflects the priority level for the link, and is used for network analysis, so that links with higher priority levels can be considered first in computing a path.
Name of the connected component table, which is created by this procedure. (If an existing table with the specified name already exists, it is updated with information for the specified link level.) The connected component table is described in Section 5.10.1.8.
Directory object that identifies the path for the log file. To create a directory object, use the SQL*Plus command CREATE DIRECTORY.
Log file containing information about spatial network operations, including any possible errors or problems.
A one-character code indicating the mode in which to open the log file: W
for write over (that is, delete any existing log file at the specified location and name, and create a new file), or A
(the default) for append (that is, append information to the existing specified log file). If you specify A
and the log file does not exist, a new log file is created.
This procedure finds, for each node in the specified network, information about all other nodes that are reachable from that node, and it stores the information in the specified connected component table. Having this information in the table enables better performance for many network analysis operations.
The following example finds the connected components for link level 1 in the SDO_PARTITIONED network, and creates or updates the SDO_PARTITIONED_CONN_COMP_TAB table. Information about the operation is added (open_mode => 'a'
) to the sdo_partitioned.log
file, located in the location associated with the directory object named LOG_DIR
.
EXECUTE SDO_NET.FIND_CONNECTED_COMPONENTS(- network => 'SDO_PARTITIONED', - link_level => 1,- component_table_name => 'sdo_partitioned_conn_comp_tab',- log_loc => 'LOG_DIR', log_file=> 'sdo_partitioned.log',- open_mode => 'a');
SDO_NET.GENERATE_NODE_LEVELS(
network IN VARCHAR2,
node_level_table_name IN VARCHAR2,
overwrite IN BOOLEAN DEFAULT FALSE,
log_loc IN VARCHAR2,
log_file IN VARCHAR2,
open_mode IN VARCHAR2 DEFAULT 'A');
Generates node levels for a specified multilevel network, and stores the information in a table.
Network name.
Table in which to store node level information. This table must have the following definition: (node_id NUMBER PRIMARY KEY, link_level NUMBER)
Controls the behavior if the table specified in node_level_table_name
already exists: TRUE
replaces the contents of that table with new data; FALSE
(the default) generates an error. (This parameter has no effect if the table specified in node_level_table_name
does not exist.)
Directory object that identifies the path for the log file. To create a directory object, use the SQL*Plus command CREATE DIRECTORY.
Log file containing information about spatial network operations, including any possible errors or problems.
A one-character code indicating the mode in which to open the log file: W
for write over (that is, delete any existing log file at the specified location and name, and create a new file), or A
(the default) for append (that is, append information to the existing specified log file). If you specify A
and the log file does not exist, a new log file is created.
If network
is not a multilevel network (one with multiple link levels), this procedure does not perform any operation.
This procedure is used internally by the SDO_NET.GENERATE_PARTITION_BLOBS procedure. Therefore, if you have executed SDO_NET.GENERATE_PARTITION_BLOBS, you do not need to execute this procedure. However, you do need to execute this procedure explicitly in these cases:
When a Java application has been configured to read partitions from the node or link tables instead of from BLOBs, and partition BLOBs have never been generated on the network.
When a higher-level node has been added or deleted in the network and the node-partition relationship has been updated. Before you execute SDO_NET.GENERATE_PARTITION_BLOB to regenerate the containing partition BLOB or BLOBs, you must manually either update the node level table or execute this procedure (SDO_NET.GENERATE_NODE_LEVELS).
The node level table name is stored in the NODE_LEVEL_TABLE_NAME column of the USER_SDO_NETWORK_METADATA view, which is described in Section 5.11.1.
The following example generates the node level information for the MY_MULTILEVEL_NET network, and stores the information in the MY_NET_NODE_LEVELS table. Information about the operation is added (open_mode => 'a'
) to the my_multilevel_net.log
file, located in the location associated with the directory object named LOG_DIR
.
EXECUTE SDO_NET.GENERATE_NODE_LEVELS(- network => 'MY_MULTILEVEL_NET', - node_level_table_name => 'MY_NET_NODE_LEVELS',- overwrite => FALSE,- log_loc => 'LOG_DIR', log_file=> 'my_multilevel_net.log',- open_mode => 'a');
SDO_NET.GENERATE_PARTITION_BLOB(
network IN VARCHAR2,
link_level IN NUMBER DEFAULT 1,
partition_id IN VARCHAR2,
include_user_data IN BOOLEAN,
log_loc IN VARCHAR2,
log_file IN VARCHAR2,
open_mode IN VARCHAR2 DEFAULT 'A',
preform_delta_update IN BOOLEAN DEFAULT FALSE);
Generates a single binary large object (BLOB) representation for a specified partition associated with a specified link level in the network, and stores the information in the existing partition BLOB table.
Network name.
Link level for links to be included in the BLOB (default = 1). The link level reflects the priority level for the link, and is used for network analysis, so that links with higher priority levels can be considered first in computing a path.
Partition ID number. Network elements associated with the specified combination of link level and partition ID are included in the generated BLOB.
TRUE
if the BLOB should include any user data of category 0 (zero) associated with the network elements represented in each BLOB, or FALSE
if the BLOB should not include any user data.
Directory object that identifies the path for the log file. To create a directory object, use the SQL*Plus command CREATE DIRECTORY.
Log file containing information about spatial network operations, including any possible errors or problems.
A one-character code indicating the mode in which to open the log file: W
for write over (that is, delete any existing log file at the specified location and name, and create a new file), or A
(the default) for append (that is, append information to the existing specified log file). If you specify A
and the log file does not exist, a new log file is created.
(Reserved for future use. The only permitted value is FALSE
, the default.)
This procedure adds a single new BLOB or replaces a single existing BLOB in the partition BLOB table, which must have been previously created using the SDO_NET.GENERATE_PARTITION_BLOBS procedure.
One use for this procedure is to perform a relatively quick update of the BLOB for a desired partition in a network that contains multiple large partitions, as opposed to than updating the BLOBs for all partitions using the SDO_NET.GENERATE_PARTITION_BLOBS procedure.
The following example generates the partition BLOB for the partition associated with partition ID 1 and link level 1 in the SDO_PARTITIONED network, and adds or replaces the appropriate BLOB in the SDO_PARTITIONED_PART_BLOB_TAB table. Any user data of category 0 (zero) associated with the network elements is also included. Information about the operation is added (open_mode => 'a'
) to the sdo_partitioned.log
file, located in the location associated with the directory object named LOG_DIR
.
EXECUTE SDO_NET.GENERATE_PARTITION_BLOB(- network => 'SDO_PARTITIONED', - link_level => 1,- partition_id => 1,- include_user_data => true,- log_loc => 'LOG_DIR', log_file=> 'sdo_partitioned.log',- open_mode => 'a');
SDO_NET.GENERATE_PARTITION_BLOBS(
network IN VARCHAR2,
link_level IN NUMBER DEFAULT 1,
partition_blob_table_name IN VARCHAR2,
include_user_data IN BOOLEAN,
commit_for_each_blob IN BOOLEAN DEFAULT TRUE,
log_loc IN VARCHAR2,
log_file IN VARCHAR2,
open_mode IN VARCHAR2 DEFAULT 'A',
preform_delta_update IN BOOLEAN DEFAULT FALSE,
regenerate_node_levels IN BOOLEAN DEFAULT FALSE);
Generates a binary large object (BLOB) representation for partitions associated with a specified link level in the network, and stores the information in the partition BLOB table.
Network name.
Link level for links to be included in each BLOB (default = 1). The link level reflects the priority level for the link, and is used for network analysis, so that links with higher priority levels can be considered first in computing a path.
Name of the partition BLOB table, which is created by this procedure. (If an existing table with the specified name already exists, it is updated with information for the specified link level.) The partition BLOB table is described in Section 5.10.1.7.
TRUE
if each BLOB should include any user data of category 0 (zero) associated with the network elements represented in each BLOB, or FALSE
if each BLOB should not include any user data.
TRUE
(the default) if each partition BLOB should be committed to the database after it is generated, or FALSE
if each BLOB should not be committed (in which case you must perform one or more explicit commit operations).
Directory object that identifies the path for the log file. To create a directory object, use the SQL*Plus command CREATE DIRECTORY.
Log file containing information about spatial network operations, including any possible errors or problems.
A one-character code indicating the mode in which to open the log file: W
for write over (that is, delete any existing log file at the specified location and name, and create a new file), or A
(the default) for append (that is, append information to the existing specified log file). If you specify A
and the log file does not exist, a new log file is created.
(Reserved for future use. The only permitted value is FALSE
, the default.)
TRUE
to regenerate the node level table for multilevel networks, or FALSE
(the default) not to regenerate the node level table for multilevel networks. You should set this parameter to TRUE
if higher-level (second level or above) nodes are added or deleted from the network, or if the level of a node is changed. The level of a node is defined as the maximum link level coming into or out of the node.
Generating partition BLOBs enables better performance for many network analysis operations, especially with large networks.
If the network is not partitioned, this procedure generates a single BLOB representing the entire network.
When this procedure is first executed on a multilevel network, it internally calls SDO_NET.GENERATE_NODE_LEVELS to create and populate the node level table (described in Section 5.10.1.10). When this procedure is called subsequently on a multilevel network, you can use the regenerate_node_levels
parameter to specify whether to overwrite the existing node level table.
Do not confuse this procedure with SDO_NET.GENERATE_PARTITION_BLOB, which regenerates a single BLOB for a specified combination of link level and partition ID, and adds that information to the existing partition BLOB table.
The following example generates partition BLOBs for link level 1 in the SDO_PARTITIONED network, and creates or updates the SDO_PARTITIONED_PART_BLOB_TAB table. Any user data of category 0 (zero) associated with the network elements is also included. Information about the operation is added (open_mode => 'a'
) to the sdo_partitioned.log
file, located in the location associated with the directory object named LOG_DIR
.
EXECUTE SDO_NET.GENERATE_PARTITION_BLOBS(- network => 'SDO_PARTITIONED', - link_level => 1,- partition_blob_table_name => 'sdo_partitioned_part_blob_tab',- include_user_data => true,- log_loc => 'LOG_DIR', log_file=> 'sdo_partitioned.log',- open_mode => 'a');
SDO_NET.GET_CHILD_FEATURE_IDS(
feature_layer_id IN NUMBER,
feature_id IN NUMBER
) RETURN SDO_NET_LAYER_FEAT_ARRAY;
Returns the feature layer ID and child feature IDs for the specified feature. (The SDO_NET_LAYER_FEAT_ARRAY type is described in Section 5.7.1.)
ID of the feature layer for the feature (that is, the parent feature).
ID of the feature.
To get the feature layer ID and feature ID of the parent features for a specified feature, use the SDO_NET.GET_PARENT_FEATURE_IDS function.
For information about features, including parent and child features, see Section 5.3.2, "Features and Feature Layers".
The following example returns and displays the child feature IDs for feature 1 in the PARENT_LAYER
feature layer.
DECLARE feature_layer_id NUMBER; feature_id NUMBER := 1; feature_ids SDO_NET_LAYER_FEAT_ARRAY; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'PARENT_LAYER'); feature_ids := sdo_net.get_child_feature_ids(feature_layer_id, feature_id); FOR i in 1..feature_ids.count LOOP --dbms_output.put_line('['||i||']'||' FEATURE_LAYER_ID = '||feature_ids(i).feature_layer_id); dbms_output.put_line('['||i||']'||' FEATURE_ID = '||feature_ids(i).feature_id); dbms_output.put_line('---'); END LOOP; END; /
For information about parent and child nodes and links in a network hierarchy, see Section 5.5.
The following example returns the child links of the link in the XYZ_NETWORK
network whose link ID is 1001.
SELECT SDO_NET.GET_CHILD_LINKS('XYZ_NETWORK', 1001) FROM DUAL; SDO_NET.GET_CHILD_LINKS('XYZ_NETWORK',1001) -------------------------------------------------------------------------------- SDO_NUMBER_ARRAY(1108, 1109)
For information about parent and child nodes and links in a network hierarchy, see Section 5.5.
The following example returns the child nodes of the node in the XYZ_NETWORK
network whose node ID is 1.
SELECT SDO_NET.GET_CHILD_NODES('XYZ_NETWORK', 1) FROM DUAL; SDO_NET.GET_CHILD_NODES('XYZ_NETWORK',1) -------------------------------------------------------------------------------- SDO_NUMBER_ARRAY(101, 102, 103, 104, 105, 106)
Returns the IDs of dangling features in a feature layer. A dangling feature is a feature that is not associated with any network elements (nodes or links).
To delete the dangling features in a feature layer, use the SDO_NET.DELETE_DANGLING_FEATURES procedure.
The following example gets the dangling features in the POI
feature layer of the GRID
network and then displays their feature IDs.
DECLARE feature_layer_id NUMBER; feature_ids SDO_NUMBER_ARRAY; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); feature_ids := sdo_net.get_dangling_features(feature_layer_id); dbms_output.put_line('Dangling Features:'); for i in 1..feature_ids.count loop dbms_output.put_line('['||i||'] '||feature_ids(i)); end loop; END; /
To delete the dangling links in a network, use the SDO_NET.DELETE_DANGLING_LINKS procedure.
The following example gets the dangling links in the GRID
network and then displays the number (count) of dangling links found.
DECLARE link_ids SDO_NUMBER_ARRAY; BEGIN link_ids := sdo_net.get_dangling_links('GRID'); dbms_output.put_line('Number of dangling Links: '||link_ids.count); END; /
To delete the dangling nodes in a network, use the SDO_NET.DELETE_DANGLING_NODES procedure.
The following example gets the dangling nodes in the GRID
network and then displays the number (count) of dangling nodes found.
DECLARE node_ids SDO_NUMBER_ARRAY; BEGIN node_ids := sdo_net.get_dangling_nodes('GRID'); dbms_output.put_line('Number of dangling Nodes: '||node_ids.count); END; /
SDO_NET.GET_FEATURE_ELEMENTS(
feature_layer_id IN NUMBER,
feature_id IN NUMBER
) RETURN SDO_NET_FEAT_ELEM_ARRAY;
Returns the feature elements in a feature layer. (The SDO_NET_FEAT_ELEM_ARRAY type is described in Section 5.7.1.)
To add a feature element to a feature, use the SDO_NET.ADD_FEATURE_ELEMENT procedure; to add multiple feature elements in a single operation, use the SDO_NET.ADD_FEATURE_ELEMENTS procedure.
The following example gets the feature layer ID for a specified feature layer, then gets and displays information about the feature elements for feature 1 in this feature layer.
DECLARE feature_layer_id NUMBER; feature_id NUMBER := 1; elements SDO_NET_FEAT_ELEM_ARRAY; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); elements := sdo_net.get_feature_elements(feature_layer_id, feature_id); FOR i in 1..elements.count LOOP dbms_output.put_line('['||i||']'||' FEAT_ELEM_TYPE = '||elements(i).feat_elem_type); dbms_output.put_line('['||i||']'||' NET_ELEM_ID = '||elements(i).net_elem_id); dbms_output.put_line('['||i||']'||' START_PERCENTAGE = '||elements(i).start_percentage); dbms_output.put_line('['||i||']'||' END_PERCENTAGE = '||elements(i).end_percentage); dbms_output.put_line('---'); END LOOP; END; /
SDO_NET.GET_FEATURE_LAYER_ID(
network_name IN VARCHAR2
feature_layer_name IN VARCHAR2
) RETURN NUMBER;
This function returns the value of the FEATURE_LAYER_ID column for the network and feature layer combination in the USER_SDO_NETWORK_FEATURE view (see Table 5-19 in Section 5.11.4).
The following example gets and displays the feature layer ID for a specified feature layer.
DECLARE feature_layer_id NUMBER; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); dbms_output.put_line('Feature layer ID for the POI feature layer is '||feature_layer_id); END; /
SDO_NET.GET_FEATURES_ON_LINKS
feature_layer_id IN NUMBER,
link_ids IN SDO_NUMBER_ARRAY
) RETURN SDO_NUMBER_ARRAY;
ID of the feature layer containing the features.
IDs of the links to check for features.
To find the IDs of features in a feature layer that reference specified nodes, use the SDO_NET.GET_FEATURES_ON_NODES procedure.
The following example gets and displays the feature IDs of features on a specified link.
DECLARE feature_layer_id NUMBER; link_ids SDO_NUMBER_ARRAY := SDO_NUMBER_ARRAY(1314); feature_ids SDO_NUMBER_ARRAY; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); feature_ids := sdo_net.get_features_on_links(feature_layer_id, link_ids); dbms_output.put_line('Features On Link '||link_ids(1)||':'); for i in 1..feature_ids.count loop dbms_output.put_line('['||i||'] '||feature_ids(i)); end loop; END; /
SDO_NET.GET_FEATURES_ON_NODES
feature_layer_id IN NUMBER,
node_ids IN SDO_NUMBER_ARRAY
) RETURN SDO_NUMBER_ARRAY;
ID of the feature layer containing the features.
IDs of the nodes to check for features.
To find the IDs of features in a feature layer that reference specified links, use the SDO_NET.GET_FEATURES_ON_LINKS procedure.
The following example gets and displays the feature IDs of features on a specified node.
DECLARE feature_layer_id NUMBER; node_ids SDO_NUMBER_ARRAY := SDO_NUMBER_ARRAY(13); feature_ids SDO_NUMBER_ARRAY; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); feature_ids := sdo_net.get_features_on_nodes(feature_layer_id, node_ids); dbms_output.put_line('Features On Node '||node_ids(1)||':'); for i in 1..feature_ids.count loop dbms_output.put_line('['||i||'] '||feature_ids(i)); end loop; END; /
This function returns the value of the GEOMETRY_TYPE column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
Network name.
ID of the node for which to return the array of inbound links.
For information about inbound links and related Network Data Model Graph concepts, see Section 5.3.
The following example returns an array of link ID numbers of the inbound links into the node whose node ID is 3 in the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_IN_LINKS('ROADS_NETWORK', 3) FROM DUAL; SDO_NET.GET_IN_LINKS('ROADS_NETWORK',3) -------------------------------------------------------------------------------- SDO_NUMBER_ARRAY(102)
This function returns an SDO_NUMBER_ARRAY object with a comma-delimited list of node ID numbers of invalid links in the specified network. If there are no invalid links, this function returns a null value.
This function returns an SDO_NUMBER_ARRAY object with a comma-delimited list of node ID numbers of invalid nodes in the specified network. If there are no invalid nodes, this function returns a null value.
This function returns an SDO_NUMBER_ARRAY object with a comma-delimited list of node ID numbers of invalid paths in the specified network. If there are no invalid paths, this function returns a null value.
This function returns an SDO_NUMBER_ARRAY object with a comma-delimited list of node ID numbers of isolated nodes in the specified network. If there are no isolated nodes, this function returns a null value.
For a brief explanation of isolated nodes in a network, see Section 5.3.
This function returns the value of the LINK_COST_COLUMN column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
The following example returns the name of the link cost column for the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_LINK_COST_COLUMN('ROADS_NETWORK') FROM DUAL; SDO_NET.GET_LINK_COST_COLUMN('ROADS_NETWORK') -------------------------------------------------------------------------------- COST
This function returns the value of the LINK_DIRECTION column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
This function returns the value of the LINK_GEOM_COLUMN column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
The following example returns the name of the link geometry column for the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_LINK_GEOM_COLUMN('ROADS_NETWORK') FROM DUAL; SDO_NET.GET_LINK_GEOM_COLUMN('ROADS_NETWORK') -------------------------------------------------------------------------------- LINK_GEOMETRY
SDO_NET.GET_LINK_GEOMETRY(
network IN VARCHAR2,
link_id IN NUMBER,
start_percentage IN NUMBER DEFAULT 0,
end_percentage IN NUMBER DEFAULT 1.0
) RETURN SDO_GEOMETRY;
Returns the entire geometry or a portion of the geometry associated with a link in a spatial network.
Network name.
ID number of the link for which to return the geometry.
Percentage of the distance along the link to be used for the start point of the returned geometry. Expressed as a number between 0 and 1.0; for example, 0.5 is 50 percent. The default value is 0; that is, the start of the returned geometry is associated with the start point of the link.
Percentage of the distance along the link to be used for the end point of the returned geometry. Expressed as a number between 0 and 1.0; for example, 0.5 is 50 percent. The default value is 1.0; that is, the end of returned geometry is associated with the end point of the link.
The following example returns the geometry associated with the link whose link ID is 103 in the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_LINK_GEOMETRY('ROADS_NETWORK', 103) FROM DUAL; SDO_NET.GET_LINK_GEOMETRY('ROADS_NETWORK',103)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, -------------------------------------------------------------------------------- SDO_GEOMETRY(2002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 8, 4, 12, 4))
This function returns the value of the LINK_TABLE_NAME column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
The following example returns the name of the link table for the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_LINK_TABLE_NAME('ROADS_NETWORK') FROM DUAL; SDO_NET.GET_LINK_TABLE_NAME('ROADS_NETWORK') -------------------------------------------------------------------------------- ROADS_LINKS
For an explanation of links and paths, see Section 5.3.
The following example returns the link ID values of links in the path in the XYZ_NETWORK
network whose path ID is 1.
SELECT SDO_NET.GET_LINKS_IN_PATH('XYZ_NETWORK', 1) FROM DUAL; SDO_NET.GET_LINKS_IN_PATH('XYZ_NETWORK',1) -------------------------------------------------------------------------------- SDO_NUMBER_ARRAY(1102, 1104, 1105)
This function returns the value of the LRS_GEOM_COLUMN column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
The following example returns the name of the LRS geometry column for the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_LRS_GEOM_COLUMN('ROADS_NETWORK') FROM DUAL; SDO_NET.GET_LRS_GEOM_COLUMN('ROADS_NETWORK') -------------------------------------------------------------------------------- ROAD_GEOM
The following example returns the LRS geometry associated with the link whose link ID is 103 in the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_LRS_LINK_GEOMETRY('ROADS_NETWORK', 103) FROM DUAL; SDO_NET.GET_LRS_LINK_GEOMETRY('ROADS_NETWORK',103)(SDO_GTYPE, SDO_SRID, SDO_POIN -------------------------------------------------------------------------------- SDO_GEOMETRY(2002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 8, 4, 12, 4))
The following example returns the LRS geometry associated with the node whose node ID is 3 in the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_LRS_NODE_GEOMETRY('ROADS_NETWORK', 3) FROM DUAL; SDO_NET.GET_LRS_NODE_GEOMETRY('ROADS_NETWORK',3)(SDO_GTYPE, SDO_SRID, SDO_POINT( -------------------------------------------------------------------------------- SDO_GEOMETRY(2001, NULL, SDO_POINT_TYPE(8, 4, NULL), NULL, NULL)
This function returns the value of the LRS_TABLE_NAME column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
The following example returns the name of the table that contains LRS geometries for the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_LRS_TABLE_NAME('ROADS_NETWORK') FROM DUAL; SDO_NET.GET_LRS_TABLE_NAME('ROADS_NETWORK') -------------------------------------------------------------------------------- ROADS
This function returns the value of the NETWORK_TYPE column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
This function returns the value of the NO_OF_HIERARCHY_LEVELS column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
For an explanation of network hierarchy, see Section 5.5.
SDO_NET.GET_NO_OF_LINKS(
network IN VARCHAR2
) RETURN NUMBER;
or
SDO_NET.GET_NO_OF_LINKS(
network IN VARCHAR2,
hierarchy_id IN NUMBER
) RETURN NUMBER;
Network name.
Hierarchy level number for which to return the number of links.
SDO_NET.GET_NO_OF_NODES(
network IN VARCHAR2
) RETURN NUMBER;
or
SDO_NET.GET_NO_OF_NODES(
network IN VARCHAR2,
hierarchy_id IN NUMBER
) RETURN NUMBER;
Network name.
Hierarchy level number for which to return the number of nodes.
For information about nodes and related concepts, see Section 5.3.
Network name.
Node ID of the node for which to return the number of links.
For information about node degree and related Network Data Model Graph concepts, see Section 5.3.
This function returns the value of the NODE_GEOM_COLUMN column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
The following example returns the name of the geometry column for nodes in the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_NODE_GEOM_COLUMN('ROADS_NETWORK') FROM DUAL; SDO_NET.GET_NODE_GEOM_COLUMN('ROADS_NETWORK') -------------------------------------------------------------------------------- NODE_GEOMETRY
The following example returns the geometry associated with the node whose node ID is 3 in the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_NODE_GEOMETRY('ROADS_NETWORK', 3) FROM DUAL; SDO_NET.GET_NODE_GEOMETRY('ROADS_NETWORK',3)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y -------------------------------------------------------------------------------- SDO_GEOMETRY(2001, NULL, SDO_POINT_TYPE(8, 4, NULL), NULL, NULL)
Network name.
Node ID of the node for which to return the number of inbound links.
For information about node degree and related Network Data Model Graph concepts, see Section 5.3.
Network name.
Node ID of the node for which to return the number of outbound links.
For information about node degree and related Network Data Model Graph concepts, see Section 5.3.
This function returns the value of the NODE_TABLE_NAME column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
The following example returns the name of the table that contains the nodes in the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_NODE_TABLE_NAME('ROADS_NETWORK') FROM DUAL; SDO_NET.GET_NODE_TABLE_NAME('ROADS_NETWORK') -------------------------------------------------------------------------------- ROADS_NODES
Network name.
ID of the node for which to return the array of outbound links.
For information about outbound links and related Network Data Model Graph concepts, see Section 5.3.
The following example returns an array of link ID numbers of the outbound links from the node whose node ID is 3 in the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_OUT_LINKS('ROADS_NETWORK', 3) FROM DUAL; SDO_NET.GET_OUT_LINKS('ROADS_NETWORK',3) -------------------------------------------------------------------------------- SDO_NUMBER_ARRAY(103, 201)
SDO_NET.GET_PARENT_FEATURE_IDS(
feature_layer_id IN NUMBER,
feature_id IN NUMBER
) RETURN SDO_NET_LAYER_FEAT_ARRAY;
Returns the feature layer ID and parent feature IDs for the specified feature. (The SDO_NET_LAYER_FEAT_ARRAY type is described in Section 5.7.1.)
ID of the feature layer for the feature (that is, the child feature).
ID of the feature.
To get the feature layer ID and feature ID of the child features for a specified feature, use the SDO_NET.GET_CHILD_FEATURE_IDS function.
For information about features, including parent and child features, see Section 5.3.2, "Features and Feature Layers".
The following example returns and displays the parent feature IDs for feature 1 in the POI
feature layer.
DECLARE feature_layer_id NUMBER; feature_id NUMBER := 1; feature_ids SDO_NET_LAYER_FEAT_ARRAY; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); feature_ids := sdo_net.get_parent_feature_ids(feature_layer_id, feature_id); FOR i in 1..feature_ids.count LOOP --dbms_output.put_line('['||i||']'||' FEATURE_LAYER_ID = '||feature_ids(i).feature_layer_id); dbms_output.put_line('['||i||']'||' FEATURE_ID = '||feature_ids(i).feature_id); dbms_output.put_line('---'); END LOOP; END; /
SDO_NET.GET_PARTITION_SIZE(
network IN VARCHAR2,
partition_id IN VARCHAR2,
link_level IN NUMBER DEFAULT 1,
include_user_data IN VARCHAR2 DEFAULT 'FALSE',
include_spatial_data IN VARCHAR2 DEFAULT 'FALSE') RETURN NUMBER;
Gets the estimated size (in bytes) for a specified combination of partition ID and link level.
Network name.
Partition ID number.
Link level (default = 1). The link level reflects the priority level for the link, and is used for network analysis, so that links with higher priority levels can be considered first in computing a path.
TRUE
if the size should include any user data associated with the network elements represented in each BLOB, or FALSE
(the default) if the size should not include any user data.
TRUE
if the size should include spatial geometry definitions associated with the network elements represented in each BLOB, or FALSE
(the default) if the size should not include spatial geometry definitions.
The returned size of a network partition is a rough estimate and might vary depending on the Java Virtual Machine and garbage collection.
For information about using partitioned networks to perform analysis using the load on demand approach, see Section 5.9.
The following example returns the number of bytes for the partition associated with partition ID 1 and link level 1 in the SDO_PARTITIONED network, not including any user data or spatial data.
SELECT SDO_NET.GET_PARTITION_SIZE('SDO_PARTITIONED', 1, 1, 'N', 'N') FROM DUAL; SDO_NET.GET_PARTITION_SIZE('SDO_PARTITIONED',1,1,'FALSE','FALSE') --------------------------------------------------------- 5192
This function returns the value of the PATH_GEOM_COLUMN column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
The following example returns the name of the geometry column for paths in the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_PATH_GEOM_COLUMN('ROADS_NETWORK') FROM DUAL; SDO_NET.GET_PATH_GEOM_COLUMN('ROADS_NETWORK') -------------------------------------------------------------------------------- PATH_GEOMETRY
This function returns the value of the PATH_TABLE_NAME column for the network in the USER_SDO_NETWORK_METADATA view (see Table 5-16 in Section 5.11.1).
The following example returns the name of the table that contains the paths in the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_PATH_TABLE_NAME('ROADS_NETWORK') FROM DUAL; SDO_NET.GET_PATH_TABLE_NAME('ROADS_NETWORK') -------------------------------------------------------------------------------- ROADS_PATHS
SDO_NET.GET_PERCENTAGE(
network IN VARCHAR2,
link_id IN NUMBER,
pt_geom IN SDO_GEOMETRY
) RETURN SDO_GEOMETRY;
Returns the percentage of the distance along a link's line string geometry of a point geometry.
This function returns a value between 0 and 1. For example, if the point is 25 percent (one-fourth) of the distance between the start node and end node for the link, the function returns .25.
If pt_geom
is not on the link geometry, the nearest point on the link geometry to pt_geom
is used.
To find the point geometry that is a specified percentage of the distance along a link's line string geometry, use the SDO_NET.GET_PT function.
The following example returns the percentage (as a decimal fraction) of the distance of a specified point along the geometry associated with the link whose link ID is 101 in the network named ROADS_NETWORK
.
SQL> SELECT SDO_NET.GET_PERCENTAGE('ROADS_NETWORK', 101, SDO_GEOMETRY(2001, NULL, SDO_POINT_TYPE(2, 2.5, NULL), NULL, NULL)) FROM DUAL; 2 3 SDO_NET.GET_PERCENTAGE('ROADS_NETWORK',101,SDO_GEOMETRY(2001,NULL,SDO_POINT_TYPE -------------------------------------------------------------------------------- .25
Returns the IDs of phantom features in a feature layer. A phantom feature is a feature that references nonexistent network elements (nodes or links).
To delete the phantom features in a feature layer, use the SDO_NET.DELETE_PHANTOM_FEATURES procedure.
The following example gets and displays the feature IDs of phantom features in a specified feature layer.
DECLARE feature_layer_id NUMBER; feature_ids SDO_NUMBER_ARRAY; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); feature_ids := sdo_net.get_phantom_features(feature_layer_id); dbms_output.put_line('Phantom Features:'); for i in 1..feature_ids.count loop dbms_output.put_line('['||i||'] '||feature_ids(i)); end loop; END; /
SDO_NET.GET_PT(
network IN VARCHAR2,
link_id IN NUMBER,
percentage IN NUMBER
) RETURN SDO_GEOMETRY;
Returns the point geometry that is a specified percentage of the distance along a link's line string geometry.
Network name.
ID number of the link for which to return the point geometry at the specified percentage
distance.
Percentage value as a decimal fraction between 0 and 1. For example, 0.25 is 25 percent.
To find the percentage along a link geometry for a specified point, use the SDO_NET.GET_PERCENTAGE function.
The following example returns the point geometry that is 25 percent of the distance from the start node along the geometry associated with the link whose link ID is 101 in the network named ROADS_NETWORK
.
SELECT SDO_NET.GET_PT('ROADS_NETWORK', 101, 0.25) FROM DUAL; SDO_NET.GET_PT('ROADS_NETWORK',101,0.25)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z) -------------------------------------------------------------------------------- SDO_GEOMETRY(2001, NULL, SDO_POINT_TYPE(2, 2.5, NULL), NULL, NULL)
Returns the string TRUE
if the network has more than one level of hierarchy; returns the string FALSE
if the network does not have more than one level of hierarchy.
For an explanation of network hierarchy, see Section 5.5.
SDO_NET.IS_LINK_IN_PATH(
network IN VARCHAR2,
path_id IN NUMBER,
link_id IN NUMBER,
) RETURN VARCHAR2;
Returns the string TRUE
if the specified link is in the specified path; returns the string FALSE
if the specified link is not in the specified path.
The following example checks if the link with link ID 1 is in the path with path ID 1 in the network named SDO_NET1
.
SELECT SDO_NET.IS_LINK_IN_PATH('SDO_NET1', 1, 1) FROM DUAL; SDO_NET.IS_LINK_IN_PATH('SDO_NET1',1,1) -------------------------------------------------------------------------------- TRUE
Returns the string TRUE
if the network is a logical network; returns the string FALSE
if the network is not a logical network.
A network can be a spatial network or a logical network, as explained in Section 5.3.
SDO_NET.IS_NODE_IN_PATH(
network IN VARCHAR2,
path_id IN NUMBER,
node_id IN NUMBER,
) RETURN VARCHAR2;
Returns the string TRUE
if the specified node is in the specified path; returns the string FALSE
if the specified node is not in the specified path.
The following example checks if the node with node ID 1 is in the path with path ID 1 in the network named SDO_NET1
.
SELECT SDO_NET.IS_NODE_IN_PATH('SDO_NET1', 1, 1) FROM DUAL; SDO_NET.IS_NODE_IN_PATH('SDO_NET1',1,1) -------------------------------------------------------------------------------- TRUE
Returns the string TRUE
if the network is a spatial network; returns the string FALSE
if the network is not a spatial network.
A network can be a spatial network or a logical network, as explained in Section 5.3.
You can further check for the geometry type of a spatial network by using the following functions: SDO_NET.LRS_GEOMETRY_NETWORK, SDO_NET.SDO_GEOMETRY_NETWORK, and SDO_NET.TOPO_GEOMETRY_NETWORK.
Loads (or reloads) the configuration for load on demand Java stored procedures from the specified XML file. The load on demand configuration is mainly for partition BLOB translation and partition cache configuration. (The Java stored procedures are classes in the package oracle.spatial.network.lod
.)
Directory object that identifies the path for the XML file. To create a directory object, use the SQL*Plus command CREATE DIRECTORY.
Name of the XML file containing the information to be loaded.
A default configuration is provided for load on demand. You can use this procedure if you need to change the default configuration.
For information about configuring the load on demand environment, including the partition cache, see Section 5.9.3.
SDO_NET.LOGICAL_PARTITION(
network IN VARCHAR2,
partition_table_name IN VARCHAR2,
max_num_nodes IN NUMBER,
log_loc IN VARCHAR2,
log_file IN VARCHAR2,
open_mode IN VARCHAR2 DEFAULT 'A',
link_level IN NUMBER DEFAULT 1);
or
SDO_NET.LOGICAL_PARTITION(
network IN VARCHAR2,
partition_table_name IN VARCHAR2,
max_num_nodes IN NUMBER,
log_loc IN VARCHAR2,
log_file IN VARCHAR2,
open_mode IN VARCHAR2 DEFAULT 'A',
link_level IN NUMBER DEFAULT 1,
part_size_tolerance IN NUMBER);
Partitions a logical network, and stores the information in the partition table.
Note:
If the logical network is a power law (scale-free) network, do not use this procedure to partition it, but instead use the SDO_NET.LOGICAL_POWERLAW_PARTITION procedure.Network name.
Name of the partition table, which is created by this procedure. (If an existing table with the specified name already exists, it is updated with partition information for the specified link level.) The partition table is described in Section 5.10.1.6.
Maximum number of nodes to include in each partition. For example, if you specify 5000 and if the network contains 50,000 nodes, each partition will have 5000 or fewer nodes, and the total number of partitions will be 10 or higher.
Directory object that identifies the path for the log file. To create a directory object, use the SQL*Plus command CREATE DIRECTORY.
Log file containing information about operations on the logical network, including any possible errors or problems.
A one-character code indicating the mode in which to open the log file: W
for write over (that is, delete any existing log file at the specified location and name, and create a new file), or A
(the default) for append (that is, append information to the existing specified log file). If you specify A
and the log file does not exist, a new log file is created.
Network link level on which to perform the partitioning (default = 1). The link level reflects the priority level for the link, and is used for network analysis, so that links with higher priority levels can be considered first in computing a path.
Allowed tolerance in partition size expressed as a decimal fraction of max_num_nodes
. Must be from 0 to 1. This parameter allows the partitioning procedure to create partitions with sizes larger than the one specified by max_num_nodes
, thereby providing the flexibility to generate partitions with reduced inter-connectivity. For example, if max_num_nodes
is 5000 and part_size_tolerance
is 0.1, a partition can include up to 5500 (5000+500 because 500 is 0.1*5000) nodes.
The format with the part_size_tolerance
parameter enables you to partition logical networks with a primary focus on reducing the inter-connectivity among partitions while keeping the edge-cut small.
After you use this procedure to create the partitions, consider using the SDO_NET.GENERATE_PARTITION_BLOBS procedure, to enable better performance for many network analysis operations, especially with large networks.
The following example creates partitions for link level 1 in the MY_LOGICAL_NET
network, and creates the MY_LOGICAL_PART_TAB table. The maximum number of nodes to be placed in any partition is 5000. Information about the operation is added (open_mode => 'a'
) to the my_logical_part.log
file located in the location associated with the directory object named LOG_DIR
.
EXECUTE SDO_NET.LOGICAL_PARTITION(network => 'MY_LOGICAL_NET', - partition_table_name => 'my_logical_part_tab',- max_num_nodes => 5000,- log_loc => 'LOG_DIR', log_file=> 'my_logical_part.log',- link_level => 1, open_mode => 'a');
The following example creates partitions for link level 1 in the MY_LOGICAL_NET
network, and creates the MY_LOGICAL_PART_TAB table. The maximum number of nodes to be placed in any partition is 5500 because of the combination of the max_num_nodes
and part_size_tolerance
values (5000 + 0.1*5000 = 5500). Information about the operation is written (open_mode => 'w'
) to the my_logical_part.log
file located in the location associated with the directory object named LOG_DIR
, replacing any existing file with that name in that location.
EXECUTE SDO_NET.LOGICAL_PARTITION(network => 'MY_LOGICAL_NET', - partition_table_name => 'my_logical_part_tab',- max_num_nodes => 5000,- log_loc => 'LOG_DIR', log_file=> 'my_logical_part.log',- link_level => 1, open_mode => 'w', part_size_tolerance => 0.1);
SDO_NET.LOGICAL_POWERLAW_PARTITION(
network IN VARCHAR2,
partition_table_name IN VARCHAR2,
max_num_nodes IN NUMBER,
log_loc IN VARCHAR2,
log_file IN VARCHAR2,
open_mode IN VARCHAR2 DEFAULT 'A',
link_level IN NUMBER DEFAULT 1,
part_size_tolerance IN NUMBER DEFAULT 0);
Partitions a logical power law (also called scale-free) network, and stores the information in the partition table. (In a power law network, the node degree values contain the power law information.)
Network name.
Name of the partition table, which is created by this procedure. (If an existing table with the specified name already exists, it is updated with partition information for the specified link level.) The partition table is described in Section 5.10.1.6.
Maximum number of nodes to include in each partition. For example, if you specify 5000 and if the network contains 50,000 nodes, each partition will have 5000 or fewer nodes, and the total number of partitions will be 10 or higher.
If the part_size_tolerance
value is greater than 0, the maximum number of nodes to include in each partition is increased, as explained in the description of that parameter.
Directory object that identifies the path for the log file. To create a directory object, use the SQL*Plus command CREATE DIRECTORY.
Log file containing information about operations on the logical power law network, including any possible errors or problems.
A one-character code indicating the mode in which to open the log file: W
for write over (that is, delete any existing log file at the specified location and name, and create a new file), or A
(the default) for append (that is, append information to the existing specified log file). If you specify A
and the log file does not exist, a new log file is created.
Network link level on which to perform the partitioning (default = 1). The link level reflects the priority level for the link, and is used for network analysis, so that links with higher priority levels can be considered first in computing a path.
Allowed tolerance in partition size expressed as a percentage of max_num_nodes
. Must be from 0 (the default) to 100.
A part_size_tolerance
value greater than 0 effectively raises the max_num_nodes
value. For example, if max_num_nodes
is 5000 and you specify part_size_tolerance
as 10, then the actual maximum number of nodes to include in each partition is 5500 (5000 + 500, because 500 is 10 percent of 5000). In deciding whether to use part_size_tolerance
and what value to specify, consider the cache size and the probability of related nodes being placed in different partitions.
After you use this procedure to create the partitions, consider using the SDO_NET.GENERATE_PARTITION_BLOBS procedure, to enable better performance for many network analysis operations, especially with large networks.
If the logical network is not a power law network, do not use this procedure, but instead use the SDO_NET.LOGICAL_PARTITION procedure.
The following example creates partitions for link level 1 in the MY_LOGICAL_PLAW_NET
network, and creates the MY_LOGICAL_PLAW_PART_TAB table. The maximum number of nodes to be placed in any partition is 5000. Information about the operation is added (open_mode => 'a'
) to the my_logical_plaw_part.log
file, located in the location associated with the directory object named LOG_DIR
.
EXECUTE SDO_NET.LOGICAL_POWERLAW_PARTITION(network => 'MY_LOGICAL_PLAW_NET', - partition_table_name => 'my_logical_plaw_part_tab',- max_num_nodes => 5000,- log_loc => 'LOG_DIR', log_file=> 'my_logical_plaw_part.log',- link_level => 1, open_mode => 'a');
Returns the string TRUE
if the network is a spatial network containing LRS geometries; returns the string FALSE
if the network is not a spatial network containing LRS geometries.
A network contains LRS geometries if the GEOMETRY_TYPE column in its entry in the USER_SDO_NETWORK_METADATA view contains the value LRS_GEOMETRY
. (The USER_SDO_NETWORK_METADATA view is explained in Section 5.11.1.)
The following example checks if the network named ROADS_NETWORK
is a spatial network containing LRS geometries.
SELECT SDO_NET.LRS_GEOMETRY_NETWORK('ROADS_NETWORK') FROM DUAL; SDO_NET.LRS_GEOMETRY_NETWORK('ROADS_NETWORK') -------------------------------------------------------------------------------- TRUE
Returns the string TRUE
if the network exists; returns the string FALSE
if the network does not exist.
If you drop a network (using the SDO_NET.DROP_NETWORK procedure), the network no longer exists.
For information about the XML API to the Network Data Model Graph, see Section 5.12.3.
The following example specifies an XML request, and sends it to a URL and returns the XML response, which it then displays.
DECLARE xml_request varchar2(4000); ndmws_url varchar2(4000); xml_response xmltype; BEGIN xml_request := '<?xml version="1.0" ?> <networkAnalysisRequest xmlns="http://xmlns.oracle.com/spatial/network" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml"> <networkName>HILLSBOROUGH_NETWORK2</networkName> <shortestPath> <startPoint> <nodeID>1533</nodeID> </startPoint> <endPoint> <nodeID>10043</nodeID> </endPoint> <subPathRequestParameter> <cost> true </cost> <isFullPath> true </isFullPath> <startLinkIndex> true </startLinkIndex> <startPercentage> true </startPercentage> <endLinkIndex> true </endLinkIndex> <endPercentage> true </endPercentage> <pathRequestParameter> <cost> true </cost> <isSimple> true </isSimple> <startNodeID>true</startNodeID> <endNodeID>true</endNodeID> <noOfLinks>true</noOfLinks> <linksRequestParameter> <onlyLinkID>true</onlyLinkID> </linksRequestParameter> <nodesRequestParameter> <onlyNodeID>true</onlyNodeID> </nodesRequestParameter> </pathRequestParameter> </subPathRequestParameter> </shortestPath> </networkAnalysisRequest>'; ndmws_url := 'http://localhost:7001/SpatialWS-SpatialWS-context-root/SpatialWSXmlServlet'; xml_response := sdo_net.POST_XML(ndmws_url, XMLTYPE(xml_request)); dbms_output.put_line(xml_response.getStringVal()); END; /
SDO_NET.REGISTER_CONSTRAINT(
constraint_name IN VARCHAR2,
class_name IN VARCHAR2,
directory_name IN VARCHAR2,
description IN VARCHAR2);
Loads the compiled Java code for the specified network constraint into the Java class repository in the database, and loads the class name into the CLASS column of the USER_SDO_NETWORK_CONSTRAINTS view (described in Section 5.11.2).
Name of the network constraint.
Fully qualified name (including the name of the package) of the class that implements the network constraint.
Name of the directory object (created using the SQL statement CREATE DIRECTORY) that identifies the location of the class file created when you compiled the network constraint.
Description of the network constraint.
Before you call this procedure, you must insert a row into the USER_SDO_NETWORK_CONSTRAINTS view, compile the code for the Java class that implements the network constraint, and use the CREATE DIRECTORY statement to create a directory object identifying the location of the compiled class. For more information about network constraints, see Section 5.8.
To delete the row for the constraint from the USER_SDO_NETWORK_CONSTRAINTS view and thus disable the constraint, use the SDO_NET.DEREGISTER_CONSTRAINT procedure.
The following example registers a network constraint named GivenProhibitedTurn
.
-- Set up the network constraint. REM REM Create the geor_dir on the file system first. REM -- Connect as SYSTEM. DECLARE -- This is the directory that contains the CLASS file generated when you -- compiled the network constraint. geor_dir varchar2(1000) := 'C:\my_data\files81\PROTOTYPES\NETWORK_CONSTRAINT\PLSQL_EXAMPLE'; BEGIN EXECUTE IMMEDIATE 'CREATE OR REPLACE DIRECTORY work_dir AS''' || geor_dir || ''''; END; / GRANT read,write on directory work_dir to net_con; -- Connect as the user that will register the constraint. REM REM Compile GivenProhibitedTurn before you register the constraint. REM BEGIN SDO_NET.REGISTER_CONSTRAINT('GivenProhibitedTurn', 'com/network/constraints/ProhibitedTurn', 'WORK_DIR', 'This is a network constraint that '|| 'prohibits certain turns'); END; /
Returns the string TRUE
if the network is a spatial network containing SDO geometries (spatial geometries without measure information); returns the string FALSE
if the network is not a spatial network containing SDO geometries.
A network contains SDO geometries if the GEOMETRY_TYPE column in its entry in the USER_SDO_NETWORK_METADATA view contains the value SDO_GEOMETRY
. (The USER_SDO_NETWORK_METADATA view is explained in Section 5.11.1.)
The following example checks if the network named ROADS_NETWORK
is a spatial network containing SDO geometries.
SELECT SDO_NET.SDO_GEOMETRY_NETWORK('ROADS_NETWORK') FROM DUAL; SDO_NET.SDO_GEOMETRY_NETWORK('ROADS_NETWORK') -------------------------------------------------------------------------------- FALSE
Minimum severity level for messages to be displayed for network operations. Must be one of the numeric constants specified in the Usage Notes.
All messages at the specified logging level and higher levels will be written. The logging levels, from highest to lowest, are:
SDO_NET.LOGGING_LEVEL_FATAL SDO_NET.LOGGING_LEVEL_ERROR SDO_NET.LOGGING_LEVEL_WARN SDO_NET.LOGGING_LEVEL_INFO SDO_NET.LOGGING_LEVEL_DEBUG SDO_NET.LOGGING_LEVEL_FINEST
The logging level is the Java logging level from the underlying implementation of this function; therefore, to see the Java logging output on the console, execute the following statements beforehand:
SET SERVEROUTPUT ON; EXECUTE DBMS_JAVA.SET_OUTPUT(10000);
Sets the Java maximum heap size for an application to run in an Oracle Java virtual machine.
If you encounter the java.lang.OutOfMemoryError
exception, you can use this procedure to increase the maximum heap size.
If you specify a value greater than the system limit, the system limit is used.
SDO_NET.SPATIAL_PARTITION(
network IN VARCHAR2,
partition_table_name IN VARCHAR2,
max_num_nodes IN NUMBER,
log_loc IN VARCHAR2,
log_file IN VARCHAR2,
open_mode IN VARCHAR2 DEFAULT 'A',
link_level IN NUMBER DEFAULT 1);
Network name.
Name of the partition table, which is created by this procedure. (If an existing table with the specified name already exists, it is updated with partition information for the specified link level.) The partition table is described in Section 5.10.1.6.
Maximum number of nodes to include in each partition. For example, if you specify 5000 and if the network contains 50,000 nodes, each partition will have 5000 or fewer nodes, and the total number of partitions will be 10 or higher.
Directory object that identifies the path for the log file. To create a directory object, use the SQL*Plus command CREATE DIRECTORY.
Log file containing information about spatial network operations, including any possible errors or problems.
A one-character code indicating the mode in which to open the log file: W
for write over (that is, delete any existing log file at the specified location and name, and create a new file), or A
(the default) for append (that is, append information to the existing specified log file). If you specify A
and the log file does not exist, a new log file is created.
Network link level on which to perform the partitioning (default = 1). The link level reflects the priority level for the link, and is used for network analysis, so that links with higher priority levels can be considered first in network computations.
After you use this procedure to create the partitions, consider using the SDO_NET.GENERATE_PARTITION_BLOBS procedure, to enable better performance for many network analysis operations, especially with large networks.
The following example creates partitions for link level 1 in the MY_PARTITIONED_NET
network, and creates the MY_PARTITIONED_NET_TAB table. The maximum number of nodes to be placed in any partition is 5000. Information about the operation is added (open_mode => 'a'
) to the my_partitioned_net.log
file, located in the location associated with the directory object named LOG_DIR
.
EXECUTE SDO_NET.SPATIAL_PARTITION(network => 'MY_PARTITIONED_NET', - partition_table_name => 'my_partitioned_net_tab',- max_num_nodes => 5000,- log_loc => 'LOG_DIR', log_file=> 'my_partitioned_net.log',- link_level => 1, open_mode => 'a');
Returns the string TRUE
if the network is a spatial network containing SDO_TOPO_GEOMETRY (topology geometry) objects; returns the string FALSE
if the network is not a spatial network containing SDO_TOPO_GEOMETRY objects.
A network contains SDO_TOPO_GEOMETRY objects if the GEOMETRY_TYPE column in its entry in the USER_SDO_NETWORK_METADATA view contains the value TOPO_GEOMETRY
. (The USER_SDO_NETWORK_METADATA view is explained in Section 5.11.1.)
The following example checks if the network named ROADS_NETWORK
is a spatial network containing SDO_TOPO_GEOMETRY objects.
SELECT SDO_NET.TOPO_GEOMETRY_NETWORK('ROADS_NETWORK') FROM DUAL; SDO_NET.TOPO_GEOMETRY_NETWORK('ROADS_NETWORK') -------------------------------------------------------------------------------- FALSE
SDO_NET.UPDATE_FEATURE(
feature_layer_id IN NUMBER,
feature_id IN NUMBER,
feature_elements IN SDO_NET_FEAT_ELEM_ARRAY DEFAULT NULL,
child_feature_ids IN SDO_NET_LAYER_FEAT_ARRAY DEFAULT NULL,
check_integrity IN BOOLEAN DEFAULT TRUE);
ID of the feature layer to which to update the feature.
ID of the feature to be updated.
Feature elements of the feature to add to any existing feature elements. If this parameter is null, the existing feature elements are not changed. If this parameter in empty, any existing feature elements are removed. (The SDO_NET_FEAT_ELEM_ARRAY type is described in Section 5.7.1.)
Child features of the feature that are to add to any existing child features. If this parameter is null, the existing child features are not changed. If this parameter in empty, any existing parent relationships for this feature with child features are removed. (The SDO_NET_LAYER_FEAT_ARRAY type is described in Section 5.7.1.)
TRUE
(the default) checks if the input network elements exist; and if any do not exist, an error is generated. FALSE
does not check if the input network elements exist.
To add a feature to a feature layer, use the SDO_NET.ADD_FEATURE procedure.
A feature layer ID is automatically generated for the feature layer.
The following example updates a specified feature by defining two feature elements and adding them.
DECLARE feature_layer_id NUMBER; feature_id NUMBER := 1; elements SDO_NET_FEAT_ELEM_ARRAY := SDO_NET_FEAT_ELEM_ARRAY(); link_id NUMBER := 1314; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); elements.extend; elements(1) := SDO_NET_FEAT_ELEM(SDO_NET.FEAT_ELEM_TYPE_POL, link_id, 0.7, null); elements.extend; elements(2) := SDO_NET_FEAT_ELEM(SDO_NET.FEAT_ELEM_TYPE_POL, link_id, 0.8, null); sdo_net.update_feature(feature_layer_id, feature_id, elements, null); END; /
SDO_NET.UPDATE_FEATURE_ELEMENT(
feature_layer_id IN NUMBER,
feature_id IN NUMBER,
sequence_number IN NUMBER,
feature_element IN SDO_NET_FEAT_ELEM,
check_integrity IN BOOLEAN DEFAULT TRUE);
ID of the feature layer for the feature.
ID of the feature.
Sequence number of the feature element to be updated.
Feature element definition to replace the specified feature element. (The SDO_NET_FEAT_ELEM type is described in Section 5.7.1.)
TRUE
(the default) checks if the input network elements exist; and if any do not exist, an error is generated. FALSE
does not check if the input network elements exist.
To add a feature element, use the SDO_NET.ADD_FEATURE_ELEMENT procedure; to add multiple feature elements in a single operation, use the SDO_NET.ADD_FEATURE_ELEMENTS procedure.
The following example updates the feature element at sequence number 2 on link ID 1314 of feature ID 1.
DECLARE feature_layer_id NUMBER; feature_id NUMBER := 1; element SDO_NET_FEAT_ELEM; link_id NUMBER := 1314; BEGIN feature_layer_id := sdo_net.get_feature_layer_id('GRID', 'POI'); element := SDO_NET_FEAT_ELEM(SDO_NET.FEAT_ELEM_TYPE_POL, link_id, 0.2, null); sdo_net.update_feature_element(feature_layer_id, feature_id, 1, element); END; /
Returns the string TRUE
if the metadata relating to links in a network is valid; returns the string FALSE
if the metadata relating to links in a network is not valid.
This function checks the following for validity: table name, geometry column, and cost column for spatial networks; measure-related information for LRS networks; topology-related information for topology networks; and hierarchy-related information for hierarchical networks.
The following example checks the validity of the metadata related to links in the network named ROADS_NETWORK
.
SELECT SDO_NET.VALIDATE_LINK_SCHEMA('ROADS_NETWORK') FROM DUAL; SDO_NET.VALIDATE_LINK_SCHEMA('ROADS_NETWORK') -------------------------------------------------------------------------------- TRUE
Returns the string TRUE
if the metadata relating to LRS information in a network is valid; returns the string FALSE
if the metadata relating to LRS information in a network is not valid.
The following example checks the validity of the metadata related to LRS information in the network named ROADS_NETWORK
.
SELECT SDO_NET.VALIDATE_LRS_SCHEMA('ROADS_NETWORK') FROM DUAL; SDO_NET.VALIDATE_LRS_SCHEMA('ROADS_NETWORK') -------------------------------------------------------------------------------- TRUE
SDO_NET.VALIDATE_NETWORK(
network IN VARCHAR2,
check_data IN VARCHAR2 DEFAULT 'FALSE'
) RETURN VARCHAR2;
Returns the string TRUE
if the network is valid; returns the string FALSE
if the network is not valid.
Network name.
TRUE
performs additional checks on the referential integrity of network data; FALSE
(the default) performs basic checks, but not additional checks, on the referential integrity of network data.
This function checks the metadata for the network and any applicable network schema structures (link, node, path, subpath, LRS). It performs basic referential integrity checks on the network data, and it optionally performs additional checks. If any errors are found, the function returns the string FALSE
.
The checks performed by this function include the following:
The network exists.
The node and link tables for the network exist, and they contain the required columns.
The start and end nodes of each link exist in the node table.
For an LRS geometry network, the LRS table exists and contains the required columns.
For a spatial network, columns for the node and path geometries exist and have spatial indexes defined on them.
If check_data
is TRUE
, additional referential integrity checking on the network data is performed. This will take longer, especially if the network is large.
Returns the string TRUE
if the metadata relating to nodes in a network is valid; returns the string FALSE
if the metadata relating to nodes in a network is not valid.
This function checks the following for validity: table name, geometry column, and cost column for spatial networks; measure-related information for LRS networks; topology-related information for topology networks; and hierarchy-related information for hierarchical networks.
The following example checks the validity of the metadata related to nodes in the network named LOG_NET1
.
SELECT SDO_NET.VALIDATE_NODE_SCHEMA('LOG_NET1') FROM DUAL; SDO_NET.VALIDATE_NODE_SCHEMA('LOG_NET1') -------------------------------------------------------------------------------- TRUE
Returns the string TRUE
if the metadata relating to partitions in a network is valid; returns the string FALSE
if the metadata relating to partitions in a network is not valid.
This function checks the validity of information in the partition table, which is described in Section 5.10.1.6.
The following example checks the validity of the metadata related to partitions in the network named SDO_PARTITIONED
.
SELECT SDO_NET.VALIDATE_PARTITION_SCHEMA('SDO_PARTITIONED') FROM DUAL; SDO_NET.VALIDATE_PARTITION_SCHEMA('SDO_PARTITIONED') -------------------------------------------------------------------------------- TRUE
Returns the string TRUE
if the metadata relating to paths in a network is valid; returns the string FALSE
if the metadata relating to paths in a network is not valid.
This function checks the following for validity: table name, geometry column, and cost column for spatial networks; measure-related information for LRS networks; topology-related information for topology networks; and hierarchy-related information for hierarchical networks.
The following example checks the validity of the metadata related to paths in the network named ROADS_NETWORK
.
SELECT SDO_NET.VALIDATE_PATH_SCHEMA('ROADS_NETWORK') FROM DUAL; SDO_NET.VALIDATE_PATH_SCHEMA('ROADS_NETWORK') -------------------------------------------------------------------------------- TRUE
Returns the string TRUE
if the metadata relating to subpaths in a network is valid; returns the string FALSE
if the metadata relating to subpaths in a network is not valid.
This function checks the validity of information in the subpath table, which is described in Section 5.10.1.5.
The following example checks the validity of the metadata related to subpaths in the network named MY_NETWORK
.
SELECT SDO_NET.VALIDATE_SUBPATH_SCHEMA('MY_NETWORK') FROM DUAL; SDO_NET.VALIDATE_SUBPATH_SCHEMA('MY_NETWORK') -------------------------------------------------------------------------------- TRUE