Skip To Content

Create LRS Network

Summary

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

Usage

  • The input workspace must contain a Pipeline Referencing LRS.

  • If the input workspace contains multiple Pipeline Referencing LRSs, a drop-down menu is provided to choose which LRS the network will be registered to. Any valid LRS within the input workspace can be entered in a Python script.

  • The LRS Network name must be 26 or fewer characters and not contain any special characters other than space, hyphen, or underscore.

  • The xy resolution, xy tolerance, and m tolerance of the output feature class will match the resolution and tolerance settings of the Pipeline Referencing LRS.

  • The unit of measure (m units) for the output LRS Network can optionally be set to a unit different than the spatial reference.

  • The default output of this tool is an LRS Network that does not support lines along with a feature class that does not contain the necessary fields to support lines. If you want an LRS network that supports lines instead, check the Include Fields to Support Lines check box and map the additional fields required for an LRS Line Network. If you want an LRS Derived Network instead, check the Derive From Line Network check box and provide the LRS Line Network to which the LRS Derived Network will be registered.

  • This tool will add information to internal metadata tables to register the output feature class as the LRS Network feature class.

  • A feature class can only be registered as one LRS Network feature class at a time. If a feature class is already registered and that name must be used as the output feature class name, delete the LRS Network to which the feature class is registered.

  • A field of the output feature class can only be mapped to one LRS Network required field.

  • The output of this tool is an LRS Network and an empty polyline feature class that will store the routes of the LRS Network.

  • The output LRS Network and output feature class will have the same name as defined by the LRS Network Name parameter.

Syntax

CreateLRSNetwork_locref (in_path, lrs_name, network_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}, {measure_unit})
ParameterExplanationData Type
in_path

The input workspace that will contain the new LRS Network. This workspace must be a geodatabase that contains a Pipeline Referencing LRS. In addition to the top level of a geodatabase, a feature dataset is also supported as a valid path.

Workspace; Feature Dataset
lrs_name

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

String
network_name

The name of the new LRS Network that will be created, as well as the name of the new feature class that will be created and registered with the LRS Network. The LRS name must be 26 or fewer characters and not contain any special characters other than space, hyphen, or underscore.

String
route_id_field

The field in the output feature class that will be mapped as the LRS Network route ID. The field type is derived from the RouteId field of the Centerline_Sequence table and will either be a string or GUID field type.

String
route_name_field

A string field in the output feature class that will be mapped as the LRS Network route name.

String
from_date_field

A date field in the output feature class that will be mapped as the LRS Network from date.

String
to_date_field

A date field in the output feature class that will be mapped as the LRS Network to date.

String
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 and a feature class to support the 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 line_network_name. This parameter is only used if the derive_from_line_network parameter is set to DERIVE.

String
include_fields_to_support_lines
(Optional)

Determines whether to add fields that support lines.

  • INCLUDEThe output of this tool will be an LRS Line Network, and the output feature class will include fields needed to support lines. The line_id_field, line_name_field, and line_order_field parameters must also be provided.
  • DO_NOT_INCLUDEThe output of this tool will not be an LRS Line Network. This is the default.
Boolean
line_id_field
(Optional)

The field in the output 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. The field type is derived from the RouteId field of the Centerline_Sequence table and will either be a string of exactly 38 characters or a GUID field type.

String
line_name_field
(Optional)

A string field in the output 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.

String
line_order_field
(Optional)

The field in the output 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. This will be a long integer field type.

String
measure_unit
(Optional)

The unit of measure (m units) that the LRS Network will use. The following inputs are valid:

  • MILESMiles. This is the default.
  • INCHESInches
  • FEETFeet
  • YARDSYards
  • NAUTICAL_MILESNautical miles
  • MILLIMETERSMillimeters
  • CENTIMETERSCentimeters
  • METERSMeters
  • KILOMETERSKilometers
  • DECIMETERSDecimeters
String

Code sample

CreateLRSNetwork example 1 (Python window)

Demonstrates how to use the CreateLRSNetwork tool in the Python window

# This will create a LRS Line Network

# tool variables
in_path = r"C:\UPDM_Data\LRS.gdb"
lrs_name = "LRS"
network_name = "LRSNetwork"
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"
measure_unit = "esriMeters"

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

# execute the tool
arcpy.CreateLRSNetwork_locref(in_path, lrs_name, network_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,
                              measure_unit)
CreateLRSNetwork example 2 (stand-alone script)

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

# Name: CreateLRSNetwork_ex2.py
# Description: Example for creating a LRS Network with Miles as the unit of measure
# Requires: ArcGIS Pipeline Referencing

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

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

arcpy.CreateLRSNetwork_locref(Input_Path, LRS_Name, Network_Name, Route_ID, Route_Name, From_Date, To_Date)
CreateLRSNetwork example 3 (stand-alone script)

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

# Name: CreateLRS_Line_Network_ex3.py
# Description: Example for creating a LRS Line Network with Feet as the unit of measure
# Requires: ArcGIS Pipeline Referencing

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

# Local variables:
Input_Path = r"C:\UPDM_Data\LRS.gdb"
LRS_Name = "LRS"
Network_Name = "EngineeringNetwork"
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"
Unit = "esriFeet"

arcpy.CreateLRSNetwork_locref(Input_Path, LRS_Name, Network_Name, Route_ID, Route_Name, From_Date, To_Date, Derive,
                              Derive_From, Line_Support, Line_ID, Line_Name, Line_Order, Unit)
CreateLRSNetwork example 4 (stand-alone script)

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

# Name: CreateLRS_Derived_Network_ex4.py
# Description: Example for creating a LRS Derived Network with Miles as the unit of measure
# Requires: ArcGIS Pipeline Referencing

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

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

arcpy.CreateLRSNetwork_locref(Input_Path, LRS_Name, Network_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