| Label | Explanation | Data 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.
| Value Table |
Merge coincident events (Optional) | Specifies whether coincident line events will be merged in the output.
| Boolean |
Location Fields (Optional) | The fields used to show 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.
| 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.
| String |
Output Format (Optional) | Specifies the format of the output.
| 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 |
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
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})| Name | Explanation | Data 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.
| Value Table |
merge_coincident_events (Optional) | Specifies whether coincident line events will be merged in the output.
| Boolean |
location_fields [location_fields,...] (Optional) | The fields used to show 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.
| 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.
| String |
output_format (Optional) | Specifies the format of the output.
| 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
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)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)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)