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, a drop-down menu is provided 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.
Syntax
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})
Parameter | Explanation | Data 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. | 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. | 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.
| 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) | Specifies whether fields that support lines will be added.
| 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.
| String |
Derived Output
Name | Explanation | Data Type |
out_feature_class | The updated network feature class. | Feature Layer |
Code sample
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.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)
# Check in license
arcpy.CheckInExtension('LocationReferencing')
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.CreateLRSNetwork_locref(Input_Path, LRS_Name, Network_Name, Route_ID, Route_Name, From_Date, To_Date)
# Check in license
arcpy.CheckInExtension('LocationReferencing')
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.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)
# Check in license
arcpy.CheckInExtension('LocationReferencing')
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.CreateLRSNetwork_locref(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