Generate Routes (Location Referencing)

Title  Generate Routes (Location Referencing)

Summary

Re-creates shapes and applies calibration changes for route features in an LRS Network.

Additionally, the tool can determine calibration changes on routes so event behaviors can be processed. These calibration changes can be due to adding, editing, or deleting calibration points outside the Location Referencing tools in ArcGIS Pro.


Usage


Syntax

Parameter Explanation
in_route_features

The LRS Network for which route shapes will be regenerated and calibration changes will be applied.

record_calibration_changes (Optional)

Specifies whether event behaviors will be applied.

  • Checked—Any calibration points created, modified, or deleted outside the Location Referencing tools will be applied to the routes in the network, and event behaviors will be applied the next time Apply Event Behaviors is run.
  • Unchecked—Calibration changes will be applied to the routes in the LRS Network, but no event behaviors will be applied. This is the default.

Code Samples

GenerateRoutes example 1 (Python window)

Demonstrates how to use GenerateRoutes in immediate mode.


# Import arcpy module
import arcpy

# Local variables
in_route_features = r'C:\Data\PipelineReferencing.gdb\LineNetwork'
record_calibration_changes = "NO_RECORD_CALIBRATION_CHANGES"

# Set current workspace
arcpy.env.workspace = "C:/Data/PipelineReferencing.gdb"

# Execute the tool
arcpy.GenerateRoutes_locref(in_route_features, record_calibration_changes)

                    

GenerateRoutes example 2 (stand-alone script)

Demonstrates how to use GenerateRoutes in a stand-alone Python script.


# Name: GenerateRoutes_ex2.py
# Description: Recreates shapes and applies calibration changes for route features in a LRS Network.
# Requirements: ArcGIS Pipeline Referencing

# Import arcpy module
import arcpy

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

# Local variables
in_route_features = r'C:\Data\PipelineReferencing.gdb\LineNetwork'
record_calibration_changes = "RECORD_CALIBRATION_CHANGES"

# Execute the tool
arcpy.GenerateRoutes_locref(in_route_features, record_calibration_changes)

                    

GenerateRoutes example 3 (stand-alone script)

Demonstrates how to use GenerateRoutes in a stand-alone Python script in a feature service.


# Name: GenerateRoutes_Pro_Ex3.py.py
# Description: This script demonstrates how to use generate routes in stand alone mode using a feature service . It is recommended to work in a version and post it into the default version.
# Requires: LocationReferencing license

# Import arcpy module.
import arcpy

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


## Input LRS route network is in feature service.  Signing in portal is required to access the feature service.
arcpy.SignInToPortal('https://yourdomain.com/portal', 'username', 'password')

## Map the input LRS route network from the feature service. Here, 1 corresponds to the input LRS route network.
in_route = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/1"


# Process : Generate Routes.
arcpy.GenerateRoutes_locref(in_route)

                    

Tags

Credits

Use limitations