Generate Linear Referenced Route Log (Location Referencing)

Available with Location Referencing license.

Summary

Creates a route log data product for routes in an LRS Network without an LRS data template.

Usage

  • This tool supports data from a file geodatabase, an enterprise geodatabase (branch versioned connection), or a feature service (published from branch versioned data).

  • This tool does not modify the inputs and will create a .csv file or a geodatabase table as the output.

  • The Effective Date parameter is used to define the temporal view of the network. Only routes active on this date will be used to calculate the output.

  • The log layers, location layers, and referent layers must be stored in the same geodatabase or feature service and have the same coordinate system as the specified LRS Network.

  • The log layer can be an LRS point event feature class, an LRS line event feature class, or an LRS intersection feature class that is registered to the specified LRS Network. A centerline feature class can also be used as a log layer when it is configured with the Address Data Management solution or a utility network.

  • The location layer must be a polygon feature class.

  • The output will be created based on the intersection of selected features from the LRS Network, log layer(s), location layer(s), and referent layer.

  • The referent layer must be an LRS point event feature class that is registered to the specified LRS Network.

  • A value of unclassified will be included in the output location fields for routes that do not overlap with the location layers.

  • You can add multiple log and location fields from the same feature class by creating selection layers and specifying each selection layer as either a log field or a location field. For example, if you have an LRS line event feature class, you can create two selection layers—Class A and Class B—and specify each selection layer as a log field.

Parameters

LabelExplanationData Type
Input Route Features

The route features that will be used to generate the route log.

Feature Layer
Effective Date

The date that will be used to define the temporal view of the network.

The default value is today's date.

Date
Log Fields
(Optional)

The fields that will be used to show event and intersection information in the output.

  • Layer—The feature layer that will be used as the log layer.
  • Field—The field that will participate in the route log.

Value Table
Merge coincident events
(Optional)

Specifies whether coincident line events will be merged in the output.

  • Checked—Coincident line events with the same value in the log field will be merged and returned as a single event.
  • Unchecked—Coincident line events with the same value in the log field will not be merged or returned as a single event. This is the default.
Boolean
Location Fields
(Optional)

The fields used to show the attributes of the polygon boundaries crossed by the routes.

  • Layer—The feature layer that will be used as the location layer.
  • Field—The field that contains the attributes of the polygon boundaries crossed by the routes.
Value Table
Referent Location
(Optional)

Specifies the method that will be used to calculate the referent offset.

  • NoneThe referent offset will not be calculated. This is the default.
  • Nearest UpstreamThe nearest referent feature upstream of the route log entry will be used to calculate the referent offset. If no upstream referent feature exists, the referent values will be empty.
  • NearestThe nearest referent feature, upstream or downstream of the route log entry, will be used to calculate the referent offset.
String
Referent Features
(Optional)

The feature layer that will be used to calculate the offset from the route log entry.

Feature Layer
Referent Field
(Optional)

The referent field that will contain the attributes of the referent features in the output.

Field
Offset Units
(Optional)

Specifies the offset units that will be used to calculate the distance between the referent feature and the route log entry.

  • Inches (US Survey)The units will be inches.
  • Feet (US Survey)The units will be feet.
  • Yards (US Survey)The units will be yards.
  • Miles (US Survey)The units will be miles.
  • Nautical Miles (US Survey)The units will be nautical miles.
  • Feet (International)The units will be international feet. This is the default.
  • Statute MilesThe units will be statute miles.
  • MillimetersThe units will be millimeters.
  • CentimetersThe units will be centimeters.
  • MetersThe units will be meters.
  • KilometersThe units will be kilometers.
  • DecimetersThe units will be decimeters.
String
Output Format
(Optional)

Specifies the format of the output.

  • CSVThe output will be a .csv file. This is the default.
  • TableThe output will be a geodatabase table.
String
Output File
(Optional)

The output .csv file that will contain the route log.

File
Output Table
(Optional)

The output geodatabase table that will contain the route log.

Table

arcpy.locref.GenerateLRRouteLog(in_route_features, effective_date, {log_fields}, {merge_coincident_events}, {location_fields}, {referent_location}, {referent_features}, {referent_field}, {offset_units}, {output_format}, {out_file}, {out_table})
NameExplanationData Type
in_route_features

The route features that will be used to generate the route log.

Feature Layer
effective_date

The date that will be used to define the temporal view of the network.

The default value is today's date.

Date
log_fields
[log_fields,...]
(Optional)

The fields that will be used to show event and intersection information in the output.

  • Layer—The feature layer that will be used as the log layer.
  • Field—The field that will participate in the route log.

Value Table
merge_coincident_events
(Optional)

Specifies whether coincident line events will be merged in the output.

  • MERGECoincident line events with the same value in the log field will be merged and returned as a single event.
  • DO_NOT_MERGECoincident line events with the same value in the log field will not be merged or returned as a single event. This is the default.
Boolean
location_fields
[location_fields,...]
(Optional)

The fields used to show the attributes of the polygon boundaries crossed by the routes.

  • Layer—The feature layer that will be used as the location layer.
  • Field—The field that contains the attributes of the polygon boundaries crossed by the routes.
Value Table
referent_location
(Optional)

Specifies the method that will be used to calculate the referent offset.

  • NONEThe referent offset will not be calculated. This is the default.
  • NEAREST_UPSTREAMThe nearest referent feature upstream of the route log entry will be used to calculate the referent offset. If no upstream referent feature exists, the referent values will be empty.
  • NEARESTThe nearest referent feature, upstream or downstream of the route log entry, will be used to calculate the referent offset.
String
referent_features
(Optional)

The feature layer that will be used to calculate the offset from the route log entry.

Feature Layer
referent_field
(Optional)

The referent field that will contain the attributes of the referent features in the output.

Field
offset_units
(Optional)

Specifies the offset units that will be used to calculate the distance between the referent feature and the route log entry.

  • INCHESThe units will be inches.
  • FEETThe units will be feet.
  • YARDSThe units will be yards.
  • MILESThe units will be miles.
  • NAUTICAL_MILESThe units will be nautical miles.
  • INTFEETThe units will be international feet. This is the default.
  • INTMILESThe units will be statute miles.
  • MILLIMETERSThe units will be millimeters.
  • CENTIMETERSThe units will be centimeters.
  • METERSThe units will be meters.
  • KILOMETERSThe units will be kilometers.
  • DECIMETERSThe units will be decimeters.
String
output_format
(Optional)

Specifies the format of the output.

  • CSVThe output will be a .csv file. This is the default.
  • TABLEThe output will be a geodatabase table.
String
out_file
(Optional)

The output .csv file that will contain the route log.

File
out_table
(Optional)

The output geodatabase table that will contain the route log.

Table

Code sample

GenerateLRRouteLog example 1 (Python window)

The following script demonstrates how to use the GenerateLRRouteLog function in the Python window.

# Name: GenerateLRRouteLog_ex1.py 
# Description: Create a route log data product that returns the location and information of signal events,
# functional class events, reference posts, intersections, and county boundaries for routes in an LRS Network
# Requirements: ArcGIS Location Referencing

# Set tool variables 
in_route_features = "CountyLog"
effective_date = "12/31/2024"
log_fields = "Signal SIGNAL_MODE; Functional_Class FUNCTIONAL_CLASS; Intersections IntersectionName"
merge_coincident_events = "DO_NOT_MERGE"
location_fields = "Counties NAME"
referent_location = "NEAREST_UPSTREAM"
referent_features = "Reference_Post"
referent_field = "POST_NAME"
offset_units = "INTFEET"
output_format = "TABLE"
out_file = None
out_table = r"C:\Data\SampleData.gdb\RL1"

# Run the tool 
arcpy.locref.GenerateLRRouteLog(in_route_features, effective_date, log_fields, merge_coincident_events,
                                location_fields, referent_location, referent_features, referent_field,
                                offset_units, output_format, out_file, out_table)
GenerateLRRouteLog example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the GenerateLRRouteLog function.

# Name: GenerateLRRouteLog_ex2.py 
# Description: For routes in an LRS Network, create a route log data product that returns the location and information of anomalies, pipes, crossing utility intersections, operating pressure,
# ILI surveys, as well as county and city boundaries
# Requirements: ArcGIS Location Referencing

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

# Set current workspace  
arcpy.env.workspace = r"C:\Data\SampleData.gdb"

# Using the Anomaly point event feature class, create a feature layer that contains active anomalies, to be used as a log layer
arcpy.management.MakeFeatureLayer("Anomaly", "Anomaly_Active", "anomalystatus = 'Active'")

# Using the Pipes line event feature class, create three feature layers, each representing a different pipe material, to be used as log layers
arcpy.management.MakeFeatureLayer("Pipes", "Pipes_CastIron", "MATERIAL = 2") 
arcpy.management.MakeFeatureLayer("Pipes", "Pipes_Copper", "MATERIAL = 4") 
arcpy.management.MakeFeatureLayer("Pipes", "Pipes_Composite", "MATERIAL = 10") 

# Set tool variables 
in_route_features = "Engineering Network"
effective_date = "12/31/2024"
log_fields = "Anomaly_Active anomalytype; Crossing Utility Intersection intersectionname; Pipes_CastIron status; Pipes_Copper status; Pipes_Composite status; Operating Pressure pressurevalue"
merge_coincident_events = "DO_NOT_MERGE"
location_fields = "Counties NAME; Cities CITY_NM"
referent_location = "NEAREST_UPSTREAM"
referent_features = "ILI Survey Readings"
referent_field = "surveytype"
offset_units = "INTFEET"
output_format = "TABLE"
out_file = None
out_table = r"C:\Data\SampleData.gdb\RL2"
 
# Run the tool 
arcpy.locref.GenerateLRRouteLog(in_route_features, effective_date, log_fields, merge_coincident_events,
                                location_fields, referent_location, referent_features, referent_field,
                                offset_units, output_format, out_file, out_table)
GenerateLRRouteLog example 3 (stand-alone script)

The following stand-alone script demonstrates how to use the GenerateLRRouteLog function with data from a feature service.

# Name: GenerateLRRouteLog_ex3.py 
# Description: Create a route log data product that returns the location and information of crashes, speed limits, pavement conditions,
# centerlines, intersections, and city boundaries for routes in a combined LRS and Address Data Management dataset that is published as a feature service
# Requires: ArcGIS Location Referencing 
 
# Import arcpy module 
import arcpy 
 
# Check out the license 
arcpy.CheckOutExtension("LocationReferencing") 
 
# Data is in a feature service. Signing in to the Enterprise portal is required to access the feature service
arcpy.SignInToPortal('https://yourdomain.com/portal', 'username', 'password') 
 
# Map the LRS Network from the feature service. Here, 11 corresponds to the LRS Network's layer ID
in_route_features = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/11"

# Create the feature layers from the feature service. The feature layers will be used as log layers
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/25", "crash")
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/24", "intersections")
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/17", "speed_limit")
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/14", "pavement_condition")
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/19", "centerline")

# Create a feature layer from the Cities layer of the feature service to be used as the location layer
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/21", "cities")

# Map the Reference Post layer from the feature service to be used as the input to the referent_features parameter
referent_features = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/26"

# Set tool variables 
effective_date = "12/31/2024"
log_fields = "crash CrashType; intersections IntersectionName; speed_limit SpeedLimit; pavement_condition Condition; centerline fullname"
merge_coincident_events = "MERGE"
location_fields = "cities name"
referent_location = "NEAREST"
referent_field = "PostName"
offset_units = "INTFEET"
output_format = "CSV"
out_file = r"C:\Data\RL3.csv"
out_table = None
 
# Run the tool 
arcpy.locref.GenerateLRRouteLog(in_route_features, effective_date, log_fields, merge_coincident_events,
                                location_fields, referent_location, referent_features, referent_field,
                                offset_units, output_format, out_file, out_table)
 
# Check in the license 
arcpy.CheckInExtension("LocationReferencing")

Environments

Licensing information

  • Basic: Requires ArcGIS Location Referencing (ArcGIS Pipeline Referencing or ArcGIS Roads and Highways)
  • Standard: Requires ArcGIS Location Referencing (ArcGIS Pipeline Referencing or ArcGIS Roads and Highways)
  • Advanced: Requires ArcGIS Location Referencing (ArcGIS Pipeline Referencing or ArcGIS Roads and Highways)

Related topics