6.11 SDO_NET.CREATE_LRS_NETWORK

Format

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);

Description

Creates a spatial network containing LRS SDO_GEOMETRY objects, creates all necessary tables, and updates the network metadata.

Parameters

network

Network name.

lrs_table_name

Name of the table containing the LRS geometry column.

lrs_geom_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).

is_directed

A Boolean value. TRUE indicates that the links are directed; FALSE indicates that the links are undirected (not directed).

no_of_hierarchy_levels

Number of hierarchy levels for links in the network. (For an explanation of network hierarchy, see Network Hierarchy.)

node_with_cost

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.

is_complex

Reserved for future use. Ignored for the current release.

node_table_name

Name of the node table to be created. (The node table is explained in Node Table.) If you use the format that does not specify this parameter, a node table named <network-name>_NODE$ is created.

node_cost_column

Name of the cost column in the node table. (The node table is explained in Node Table.) If you use the format that does not specify this parameter, the geometry column is named COST.

link_table_name

Name of the link table to be created. (The link table is explained in Link Table.) If you use the format that does not specify this parameter, a link table named <network-name>_LINK$ is created.

link_cost_column

Name of the cost column in the link table. (The link table is explained in Link Table.) If you use the format that does not specify this parameter, the geometry column is named COST.

path_table_name

Name of the path table to be created. (The path table is explained in Path Table.) If you use the format that does not specify this parameter, a path table named <network-name>_PATH$ is created.

path_geom_column

Name of the geometry column in the path table. (The path table is explained in Path Table.) If you use the format that does not specify this parameter, the geometry column is named GEOMETRY.

path_link_table_name

Name of the path-link table to be created. (The path-link table is explained in Path-Link Table.) If you use the format that does not specify this parameter, a path-link table named <network-name>_PLINK$ is created.

subpath_table_name

Name of the subpath table to be created. (The subpath table is explained in Subpath Table.).

subpath_geom_column

Name of the geometry column in the subpath table. (The subpath table is explained in Subpath Table.)

storage_parameters

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.

Usage Notes

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 xxx_SDO_NETWORK_METADATA Views).

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.

Examples

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);