Skip To Content

Create LRS Network From Existing Dataset

Summary

Creates an LRS Network using an existing polyline feature class.

Usage

  • Creates an LRS Network within an ArcGIS Pipeline Referencing linear referencing system (LRS).

  • The input feature class must be empty.

  • The input feature class must not already be registered with an existing Pipeline Referencing LRS Network.

  • If the input workspace contains multiple LRSs, the selected LRS will be used for network registration.

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

  • The xy resolution and xy tolerance of the input feature class must match the resolution and tolerance settings of the Pipeline Referencing LRS.

  • 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.

Syntax

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})
ParameterExplanationData Type
in_feature_class

The input feature class that will be registered as the LRS Network. The feature class's name must be 26 or fewer characters. The feature class must reside within 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)

Determines if 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)

Determines if 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 of 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

Code sample

CreateLRSNetworkFromExistingDataset example 1 (Python window)

Demonstrates how to use the CreateLRSNetworkFromExistingDataset tool in the Python window

# This will create a LRS Line Network

# tool variables
in_feature_class = r"C:\UPDM_Data\LRS.gdb\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)
CreateLRSNetworkFromExistingDataset example 2 (stand-alone script)

Demonstrates how to use the CreateLRSNetworkFromExistingDataset tool as a stand-alone Python script for creating an LRS Network from an existing polyline feature class.

# Name: CreateLRSNetworkFromExisting_ex2.py
# Description: Example for creating a LRS Network from an existing polyline feature class
# Requires: ArcGIS Pipeline Referencing

# Import arcpy module
import arcpy
 
# Check out any necessary licenses
arcpy.CheckOutExtension("LocationReferencing")

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

arcpy.CreateLRSNetworkFromExistingDataset_locref(Input_FC, LRS_Name, Route_ID, Route_Name, From_Date, To_Date)
CreateLRSNetworkFromExistingDataset example 3 (stand-alone script)

Demonstrates how to use the CreateLRSNetworkFromExistingDataset tool as a stand-alone Python script for creating an LRS Line Network from an existing polyline feature class.

# Name: CreateLRS_Line_NetworkFromExisting_ex3.py
# Description: Example for creating a LRS Line Network from an existing polyline feature class
# Requires: ArcGIS Pipeline Referencing

# Import arcpy module
import arcpy
 
# Check out any necessary licenses
arcpy.CheckOutExtension("LocationReferencing")

# Local variables:
Input_FC = r"C:\UPDM_Data\LRS.gdb\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"

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)
CreateLRSNetworkFromExistingDataset example 4 (stand-alone script)

Demonstrates how to use the CreateLRSNetworkFromExistingDataset tool as a stand-alone Python script for creating an LRS Derived Network from an existing polyline feature class.

# Name: CreateLRS_Derived_NetworkFromExisting_ex4.py
# Description: Example for creating a LRS Derived Network from an existing polyline feature class
# Requires: ArcGIS Pipeline Referencing

# Import arcpy module
import arcpy
 
# Check out any necessary licenses
arcpy.CheckOutExtension("LocationReferencing")

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

arcpy.CreateLRSNetworkFromExistingDataset_locref(Input_FC, LRS_Name, Route_ID, Route_Name, From_Date, To_Date, Derive, Derive_From)

Environments

Licensing information

  • ArcGIS Desktop Basic: Requires ArcGIS Pipeline Referencing
  • ArcGIS Desktop Standard: Requires ArcGIS Pipeline Referencing
  • ArcGIS Desktop Advanced: Requires ArcGIS Pipeline Referencing

Related topics