Create LRS Network (Location Referencing)

Summary

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

Usage

  • The input workspace must contain a Location Referencing LRS.

  • If the input workspace contains more than one Location Referencing LRS, use the drop-down menu to choose the LRS to which the network will be registered. Any valid LRS in the input workspace can be entered in a Python script.

  • The LRS Network name must be 26 or fewer characters and cannot contain any special characters other than underscores.

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

  • The unit of measure (m-units) for the output LRS Network can be set to a unit other than that of 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, check the Include Fields to Support Lines parameter and map the additional fields required for an LRS line network. If you want an LRS derived network, check the Derive From Line Network parameter 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 in 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.

  • When using an enterprise geodatabase as an input to this tool, the current database user cannot be SDE or DBO.

Parameters

LabelExplanationData Type
Input Location

The input workspace that will contain the new LRS Network. This workspace must be a geodatabase that contains a Location 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 Input Location parameter value.

String
LRS Network Name

The name of the LRS Network that will be created, as well as the name of the feature class that will be created and registered with the LRS Network. The LRS Network name must be 26 or fewer characters and cannot contain special characters other than underscores.

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 must be either string or GUID 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)

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

  • Checked—The output will be an LRS derived network and a feature class to support the LRS derived network. The Line Network Name parameter value must also be provided.
  • Unchecked—The output 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 value. This parameter is only used if the Derive From Line Network parameter is checked.

String
Include Fields to Support Lines
(Optional)

Specifies whether fields that support lines will be added.

  • Checked—The output will be an LRS line network, and the output feature class will include fields that support lines. The Line ID Field, Line Name Field, and Line Order Field parameter values must also be provided.
  • Unchecked—The output 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 checked. 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 checked.

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 checked. This will be a long integer field type.

String
Measure Unit
(Optional)

Specifies the unit of measure (m-unit) the LRS Network will use.

  • Miles (US Survey)The unit of measure will be miles. This is the default.
  • Inches (US Survey)The unit of measure will be inches.
  • Feet (US Survey)The unit of measure will be feet.
  • Yards (US Survey)The unit of measure will be yards.
  • Nautical miles (US Survey)The unit of measure will be nautical miles.
  • Feet (International)The unit of measure will be international feet.
  • MillimetersThe unit of measure will be millimeters.
  • CentimetersThe unit of measure will be centimeters
  • MetersThe unit of measure will be meters.
  • KilometersThe unit of measure will be kilometers.
  • DecimetersThe unit of measure will be decimeters.
String

Derived Output

LabelExplanationData Type
Output Network Feature Class

The updated network feature class.

Feature Layer

arcpy.locref.CreateLRSNetwork(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})
NameExplanationData Type
in_path

The input workspace that will contain the new LRS Network. This workspace must be a geodatabase that contains a Location 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 parameter value.

String
network_name

The name of the LRS Network that will be created, as well as the name of the feature class that will be created and registered with the LRS Network. The LRS Network name must be 26 or fewer characters and cannot contain special characters other than underscores.

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 must be either string or GUID 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)

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

  • DERIVEThe output will be an LRS derived network and a feature class to support the LRS derived network. The line_network_name parameter value must also be provided.
  • DO_NOT_DERIVEThe output 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 value. 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 fields that support lines will be added.

  • INCLUDEThe output will be an LRS line network, and the output feature class will include fields that support lines. The line_id_field, line_name_field, and line_order_field parameter values must also be provided.
  • DO_NOT_INCLUDEThe output 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)

Specifies the unit of measure (m-unit) the LRS Network will use.

  • MILESThe unit of measure will be miles. This is the default.
  • INCHESThe unit of measure will be inches.
  • FEETThe unit of measure will be feet.
  • YARDSThe unit of measure will be yards.
  • NAUTICAL_MILESThe unit of measure will be nautical miles.
  • INTFEETThe unit of measure will be international feet.
  • MILLIMETERSThe unit of measure will be millimeters.
  • CENTIMETERSThe unit of measure will be centimeters
  • METERSThe unit of measure will be meters.
  • KILOMETERSThe unit of measure will be kilometers.
  • DECIMETERSThe unit of measure will be decimeters.
String

Derived Output

NameExplanationData Type
out_feature_class

The updated network feature class.

Feature Layer

Code sample

CreateLRSNetwork example 1 (Python window)

Use the CreateLRSNetwork tool in the Python window to create an LRS line network.

# Name: CreateLRS_Line_Network_ex1.py
# Description: Creates an LRS Line Network with feet as the unit of measure.
# Requires: ArcGIS Location Referencing

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

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

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

# Execute the tool
arcpy.locref.CreateLRSNetwork(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)

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

Use the CreateLRSNetwork tool as a stand-alone Python script to create an LRS Network.

# Name: CreateLRSNetwork_ex2.py
# Description: Creates an LRS Network with miles as the unit of measure.
# Requires: ArcGIS Location Referencing

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

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

# Execute the tool
arcpy.locref.CreateLRSNetwork(Input_Path, LRS_Name, Network_Name, Route_ID, Route_Name, From_Date, To_Date)

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

Use the CreateLRSNetwork tool as a stand-alone Python script to create an LRS line network.

# Name: CreateLRS_Line_Network_ex3.py
# Description: Creates an LRS Line Network with feet as the unit of measure.
# Requires: ArcGIS Location Referencing

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

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

# Execute the tool
arcpy.locref.CreateLRSNetwork(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)

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

Use the CreateLRSNetwork tool as a stand-alone Python script to create an LRS derived network.

# Name: CreateLRS_Derived_Network_ex4.py
# Description: Creates an LRS Derived Network with miles as the unit of measure.
# Requires: ArcGIS Location Referencing

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

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

# Execute the tool
arcpy.locref.CreateLRSNetwork(Input_Path, LRS_Name, Network_Name, Route_ID, Route_Name, From_Date, To_Date, Derive, Derive_From)

# 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