Create LRS Network From Existing Dataset (Location Referencing)

Available with Location Referencing license.

Summary

Creates an LRS Network using an existing polyline feature class.

Usage

  • Creates an LRS Network in an ArcGIS Location Referencing linear referencing system (LRS).

  • The input feature class must be empty and reside in a feature dataset that contains an LRS dataset. The input feature class must not already be registered with an existing Location Referencing LRS Network.

  • If the input workspace contains more than one LRS, the selected LRS will be used for network registration.

  • The input feature class name must be 26 or fewer characters.

  • The x,y resolution and x,y tolerance of the input feature class must match the resolution and tolerance settings of the Location Referencing LRS.

    Learn more about Tolerance and resolution settings for the LRS in ArcGIS Pipeline Referencing and tolerance and resolution settings in ArcGIS Roads and Highways.

  • The unit of measure and m-tolerance for the output LRS Network will be derived from the centerline feature class spatial reference within the input feature class workspace.

  • By default, the tool will output an LRS Network that does not support lines. To create an LRS Network that supports lines, enable the Include Fields to Support Lines parameter and map the additional fields required for an LRS line network (line ID, line name, and line order). To create an LRS derived network, enable the Derive From Line Network parameter and provide the LRS line network to which the LRS derived network will be registered.

  • This tool does not alter the input feature class and will instead add information to internal metadata tables to register the input feature class as the LRS Network feature class.

  • A feature class can only be registered as one LRS Network feature class at a time. Delete the LRS Network to which a feature class is registered to use a feature class that is already registered.

  • An input field can only be mapped to one LRS Network field parameter at a time.

  • The output of this tool is an LRS Network that will reside in the same workspace as the input feature class.

  • The route ID can be a single field or a concatenation of multiple fields. If the network uses a concatenated route ID, all of the fields that compose the route ID must be present in the network feature class.

Syntax

arcpy.locref.CreateLRSNetworkFromExistingDataset(in_feature_class, lrs_name, route_id_field, route_name_field, from_date_field, to_date_field, {derive_from_line_network}, {line_network_name}, {include_fields_to_support_lines}, {line_id_field}, {line_name_field}, {line_order_field}, {route_id_configuration}, {individual_route_id_fields})
ParameterExplanationData Type
in_feature_class

The input feature class that will be registered as the LRS Network. The name of the feature class must be 26 or fewer characters. The feature class must reside in a geodatabase that contains a Pipeline Referencing LRS. The name of this feature class will be used as the name of the LRS Network.

Feature Layer
lrs_name

The LRS name to which the new LRS Network will be registered. The LRS must reside in the same geodatabase as the in_feature_class.

String
route_id_field

The field in the in_feature_class that will be mapped as the LRS Network route ID. This must be a string or GUID field type.

Field
route_name_field

A string field in the in_feature_class that will be mapped as the LRS Network route name.

Field
from_date_field

A date field in the in_feature_class that will be mapped as the LRS Network from date.

Field
to_date_field

A date field in the in_feature_class that will be mapped as the LRS Network to date.

Field
derive_from_line_network
(Optional)

Specifies whether the network will be configured as an LRS derived network.

  • DERIVEThe output of this tool will be an LRS derived network. The line_network_name parameter must also be provided.
  • DO_NOT_DERIVEThe output of this tool will not be an LRS derived network. This is the default.
Boolean
line_network_name
(Optional)

The name of the LRS line network to which the output LRS derived network will be registered. The input LRS line network must reside in the same geodatabase workspace as the in_feature_class. This parameter is only used if the derive_from_line_network parameter is set to DERIVE.

String
include_fields_to_support_lines
(Optional)

Specifies whether the network will be configured to support lines.

  • INCLUDEThe output of this tool will be an LRS line network. The line_id_field, line_name_field, and line_order_field parameters must also be provided.
  • DO_NOT_INCLUDE The output of this tool will not be an LRS line network. This is the default.
Boolean
line_id_field
(Optional)

The field in the in_feature_class that will be mapped as the LRS Network line ID. This parameter is only used if the include_fields_to_support_lines parameter is set to INCLUDE. This must be a string or GUID field type and must match the field type and length of the route ID field in the centerline sequence table.

Field
line_name_field
(Optional)

A string field in the in_feature_class that will be mapped as the LRS Network line name. This parameter is only used if the include_fields_to_support_lines parameter is set to INCLUDE.

Field
line_order_field
(Optional)

An integer field in the in_feature_class that will be mapped as the LRS Network line order. This parameter is only used if the include_fields_to_support_lines parameter is set to INCLUDE.

Field
route_id_configuration
(Optional)

Specifies the route ID configuration for the LRS Network.

  • AUTOGENERATED_ROUTE_IDThe route ID field will be an automatically generated GUID. The route name can be configured as an LRS field. This is the default.
  • SINGLE_FIELD_ROUTE_IDThe route ID field will be a single user-generated field. Only nonline networks are supported.
  • MULTI_FIELD_ROUTE_IDThe route ID field will be a user-generated field concatenated from more than one field to form the route ID. Only nonline networks are supported.
String
individual_route_id_fields
[individual_route_id_fields,...]
(Optional)

The individual fields in the in_feature_class that will be used to form the route ID. This parameter is only used if the route_id_configuration parameter is set to MULTI_FIELD_ROUTE_ID. The fields must be either string or integer field types.

Field

Derived Output

NameExplanationData Type
out_feature_class

The updated network feature layer.

Feature Layer

Code sample

CreateLRSNetworkFromExistingDataset example 1 (Python window)

Use the CreateLRSNetworkFromExistingDataset tool in the Python window to create an LRS line network from an existing polyline feature class.

# Name: Create_LRS_Event_From_Existing_Dataset_ex1.py
# Description: Create an LRS Line Network in the Python window.
# Requires: ArcGIS Location Referencing 

# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Tool variables
in_feature_class = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork"
lrs_name = "LRS"
route_id_field = "RouteId"
route_name_field = "RouteName"
from_date_field = "FromDate"
to_date_field = "ToDate"
derive_from_line_network = "DO_NOT_DERIVE"
line_network_name = ""
include_fields_to_support_lines = "INCLUDE"
line_id_field = "LineId"
line_name_field = "LineName"
line_order_field = "LineOrder"

# Set current workspace
arcpy.env.workspace = "C:\UPDM_Data\LRS.gdb"
 
# Execute the tool
arcpy.CreateLRSNetworkFromExistingDataset_locref(in_feature_class, lrs_name, route_id_field, route_name_field,
                                                 from_date_field, to_date_field, derive_from_line_network,
                                                 line_network_name, include_fields_to_support_lines, line_id_field,
                                                 line_name_field, line_order_field)
                                                 

# Check in license
arcpy.CheckInExtension('LocationReferencing')
CreateLRSNetworkFromExistingDataset example 2 (stand-alone script)

Use the CreateLRSNetworkFromExistingDataset tool in a stand-alone Python script to create an LRS Network from an existing polyline feature class.

# Name: CreateLRSNetworkFromExisting_ex2.py
# Description: Create an LRS Network from an existing polyline feature class.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy
 
# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Local variables:
Input_FC = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork"
LRS_Name = "LRS"
Route_ID = "RouteId"
Route_Name = "RouteName"
From_Date = "FromDate"
To_Date = "ToDate"

# Execute the tool
arcpy.CreateLRSNetworkFromExistingDataset_locref(Input_FC, LRS_Name, Route_ID, Route_Name, From_Date, To_Date)

# Check in license
arcpy.CheckInExtension('LocationReferencing')
CreateLRSNetworkFromExistingDataset example 3 (stand-alone script)

Use the CreateLRSNetworkFromExistingDataset tool in a stand-alone Python script to create an LRS line network from an existing polyline feature class.

# Name: CreateLRS_Line_NetworkFromExisting_ex3.py
# Description: Create an LRS Line Network from an existing polyline feature class.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy
 
# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Local variables:
Input_FC = r"C:\UPDM_Data\LRS.gdb\LRS\EngineeringNetwork"
LRS_Name = "LRS"
Route_ID = "RouteId"
Route_Name = "RouteName"
From_Date = "FromDate"
To_Date = "ToDate"
Derive = "DO_NOT_DERIVE"
Derive_From = ""
Line_Support = "INCLUDE"
Line_ID = "LineId"
Line_Name = "LineName"
Line_Order = "LineOrder"

# Execute the tool
arcpy.CreateLRSNetworkFromExistingDataset_locref(Input_FC, LRS_Name, Route_ID, Route_Name, From_Date, To_Date, Derive,
                                                 Derive_From, Line_Support, Line_ID, Line_Name, Line_Order)

# Check in license
arcpy.CheckInExtension('LocationReferencing')
CreateLRSNetworkFromExistingDataset example 4(stand-alone script)

Use the CreateLRSNetworkFromExistingDataset tool in a stand-alone Python script to create an LRS derived network from an existing polyline feature class.

# Name: CreateLRS_Derived_NetworkFromExisting_ex4.py
# Description: Create an LRS Derived Network from an existing polyline feature class.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy
 
# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Local variables:
Input_FC = r"C:\UPDM_Data\LRS.gdb\LRS\DerivedNetwork"
LRS_Name = "LRS"
Route_ID = "RouteId"
Route_Name = "RouteName"
From_Date = "FromDate"
To_Date = "ToDate"
Derive = "DERIVE"
Derive_From = "EngineeringNetwork"

# Execute the tool
arcpy.CreateLRSNetworkFromExistingDataset_locref(Input_FC, LRS_Name, Route_ID, Route_Name, From_Date, To_Date, Derive, Derive_From)

# Check in license
arcpy.CheckInExtension('LocationReferencing')
CreateLRSNetworkFromExistingDataset example 5 (Python window)

Use the CreateLRSNetworkFromExistingDataset tool in the Python window to create a user-defined, single-field route ID from an existing polyline feature class.

# Name: CreateLRSNetworkFromExisting_ex5.py
# Description: Create a user-defined, single-field route ID in an LRS Network.
# Requires: ArcGIS Location Referencing

# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Tool variables
in_feature_class = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork"
lrs_name = "LRS"
route_id_field = "RouteId"
route_name_field = ""
from_date_field = "FromDate"
to_date_field = "ToDate"
derive_from_line_network = ""
line_network_name = ""
include_fields_to_support_lines = ""
line_id_field = ""
line_name_field = ""
line_order_field = ""
route_id_configuration = "SINGLE_FIELD_ROUTE_ID"
individual_route_id_fields = ""

# Set current workspace
arcpy.env.workspace = "C:\UPDM_Data\LRS.gdb"

# Execute the tool
arcpy.CreateLRSNetworkFromExistingDataset_locref(in_feature_class, lrs_name, route_id_field, route_name_field, from_date_field, to_date_field, derive_from_line_network, line_network_name, include_fields_to_support_lines, line_id_field, line_name_field, line_order_field, route_id_configuration, Individual_route_id_fields)

# Check in license
arcpy.CheckInExtension('LocationReferencing')
CreateLRSNetworkFromExistingDataset example 6 (Python window)

Use the CreateLRSNetworkFromExistingDataset tool in the Python window to create a user-defined, multifield route ID from an existing polyline feature class.

# Name: CreateLRSNetworkFromExisting_ex6.py
# Description: Create a user-defined, single-field route ID in an LRS Network.
# Requires: ArcGIS Location Referencing

# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Tool variables
in_feature_class = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork"
lrs_name = "LRS"
route_id_field = "RouteId"
route_name_field = ""
from_date_field = "FromDate"
to_date_field = "ToDate"
derive_from_line_network = ""
line_network_name = ""
include_fields_to_support_lines = ""
line_id_field = ""
line_name_field = ""
line_order_field = ""
route_id_configuration = "MULTI_FIELD_ROUTE_ID"
individual_route_id_fields = "Field1;Field2;Field3"

# Set current workspace
arcpy.env.workspace = "C:\UPDM_Data\LRS.gdb"

# Execute the tool
arcpy.CreateLRSNetworkFromExistingDataset_locref(in_feature_class, lrs_name, route_id_field, route_name_field, from_date_field, to_date_field, derive_from_line_network, line_network_name, include_fields_to_support_lines, line_id_field, line_name_field, line_order_field, route_id_configuration, Individual_route_id_fields)

# Check in licenses
arcpy.CheckInExtension('LocationReferencing')
CreateLRSNetworkFromExistingDataset example 7 (stand-alone script)

Use the CreateLRSNetworkFromExistingDataset tool in the Python window to create a user-defined, single-field route ID network from an existing polyline feature class.

# Name: CreateLRSNetworkFromExisting_ex7.py
# Description: Create a user defined, single-field route ID in an LRS Network from an existing polyline feature class.
# Requires: ArcGIS Location Referencing

# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Local variables:
Input_FC = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork "
LRS_Name = "LRS"
Route_ID = "RouteID"
Route_Name = ""
From_Date = "FromDate"
To_Date = "ToDate"
Derive = ""
Derive_From = ""
Line_Support = ""
Line_ID = ""
Line_Name = ""
Line_Order = ""
route_id_configuration = "SINGLE_FIELD_ROUTE_ID"
individual_route_id_fields = ""

# Execute the tool
arcpy.CreateLRSNetworkFromExistingDataset_locref(Input_FC, LRS_Name, Route_ID, Route_Name, From_Date, To_Date, Derive, Derive_From, Line_Support, Line_ID, Line_Name, Line_Order, route_id_configuration, individual_route_id_fields)

# Check in license
arcpy.CheckInExtension('LocationReferencing')
CreateLRSNetworkFromExistingDataset example 8 (stand-alone script)

Use the CreateLRSNetworkFromExistingDataset tool in the Python window to create a user-defined, multifield route ID network from an existing polyline feature class.

# Name: CreateLRSNetworkFromExisting_ex8.py
# Description: Create a user defined, multifield route ID network from an existing polyline feature class.
# Requires: Location Referencing

# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Local variables:
Input_FC = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork"
LRS_Name = "LRS"
Route_ID = "RouteID"
Route_Name = ""
From_Date = "FromDate"
To_Date = "ToDate"
Derive = ""
Derive_From = ""
Line_Support = ""
Line_ID = ""
Line_Name = ""
Line_Order = ""
route_id_configuration = "MULTI_FIELD_ROUTE_ID"
individual_route_id_fields = "Field1;Field2;Field3"

# Execute the tool
arcpy.CreateLRSNetworkFromExistingDataset_locref(Input_FC, LRS_Name, Route_ID, Route_Name, From_Date, To_Date, Derive, Derive_From, Line_Support, Line_ID, Line_Name, Line_Order, route_id_configuration, individual_route_id_fields)

# Check in license
arcpy.CheckInExtension('LocationReferencing')

Environments

Licensing information

  • Basic: Requires ArcGIS Location Referencing
  • Standard: Requires ArcGIS Location Referencing
  • Advanced: Requires ArcGIS Location Referencing

Related topics