5.7 Feature Modeling

You can model objects of interest on the network as features.

A feature consists of one or many feature elements. A feature element can be a point, a link, or a partial link along the network. You can define feature layers on top of a network. For example, restaurants and hotels can each be defined as a feature layer on a road network, and switches can be defined as a feature layer on an electrical network.

The following are the typical steps for using feature modeling.

  1. Create a feature layer.

    For example, the points of interest (POIs) on a road network can be modeled as features. Each type of POI (hotels, restaurants, hospitals, schools, and so on) corresponds to one feature layer. The following example adds a feature layer for hotels:

    sdo_net.add_feature_layer(
       'US_ROAD_NETWORK', --network name
       'HOTEL',           --feature layer name
       2,                 --feature layer type: point on link
       'HOTEL_TAB',       --feature table or view name
       'HOTEL_NET_REL',   --relation table or view name
       null);             --hierarchy table or view name
    
  2. Register feature user data, if any application-specific feature attributes are potentially useful in feature analysis.

    Feature user data is registered by adding an entry in the XXX_SDO_NETWORK_USER_DATA view, just like registering the user data for network nodes or links, except that the TABLE_TYPE column is set to the name of the feature table. The following example adds hotel name as user data for hotel features:

    INSERT INTO USER_SDO_NETWORK_USER_DATA(
       network, table_type, data_name, data_type, category_id)
    VALUES(
       'US_ROAD_NETWORK',  --network name
       'HOTEL_TAB', 	       --feature table or view name
       'NAME',             --user data name, i.e., name of the user data column
       'VARCHAR2',         --user data type
       3);                 --user data category
    
  3. Add, update, or delete features on the feature layer.

    If the content of feature tables, feature element relationship table, and feature hierarchy table (all described in Feature Layer Tables) -- or any combination of these tables -- is managed by the data provider, then you can skip this step. Otherwise, you can call procedures in the SDO_NET package, such as ADD_FEATURE, UPDATE_FEATURE, DELETE_FEATURES, to add, update or delete features in a feature layer. (The SDO_NET subprograms are described in SDO_NET Package Subprograms.)

  4. Perform feature analysis using NetworkAnalyst. The feature analysis functions include:

    • Shortest paths between features

    • Nearest (reaching) features

    • Within (reaching) cost features

5.7.1 Data Types Used for Feature Modeling

This section describes the following PL/SQL data types that are used for parameters and return values of some SDO_NET package subprograms related to feature modeling:

  • SDO_NET_FEAT_ELEM_ARRAY

  • SDO_NET_FEAT_ELEM

  • SDO_NET_LAYER_FEAT_ARRAY

  • SDO_NET_LAYER_FEAT

  • SDO_NETWORK_NVP_TAB

  • SDO_NETWORK_NVP

SDO_NET_FEAT_ELEM_ARRAY is defined as VARRAY(1024) OF MDSYS.SDO_NET_FEAT_ELEM.

SDO_NET_FEAT_ELEM is defined as:

FEAT_ELEM_TYPE    NUMBER
NET_ELEM_ID       NUMBER
START_PERCENTAGE  NUMBER
END_PERCENTAGE    NUMBER

SDO_NET_LAYER_FEAT_ARRAY is defined as VARRAY(1024) OF MDSYS.SDO_NET_LAYER_FEAT.

SDO_NET_LAYER_FEAT is defined as:

FEATURE_LAYER_ID  NUMBER
FEATURE_ID        NUMBER

SDO_NETWORK_NVP_TAB is defined as TABLE OF MDSYS.SDO_NETWORK_NVP.

SDO_NETWORK_NVP is defined as:

NAME   VARCHAR2(128)
VALUE  VARCHAR2(1024)