Derive Event Measures (Location Referencing)

Summary

Populates and updates the DerivedRouteID field and measure values on point and line events with those fields configured and enabled.

Usage

  • An LRS dataset is required to run this tool.

    Learn more about creating an LRS dataset in ArcGIS Pipeline Referencing or creating an LRS dataset in ArcGIS Roads and Highways .

  • This tool is designed to be run as part of a larger workflow. Run the Apply Event Behaviors and Generate Routes tools before running Derive Event Measures. Running this tool without running the previous tools in the workflow may result in inaccurate data.

  • It is recommended that you run this tool on the file geodatabase at the initial migration of the data. It will run faster this way because the operation must modify each event record in the database. Once in production, the tool can be run on a selection set of the routes that have been modified to significantly improve the performance time.

  • The input event feature layer must have the DerivedRouteID field and measure fields configured.

  • Selection sets on the input route features layer are honored.

  • Selection sets on event layers are ignored and not honored.

  • This tool can be run on one, multiple, or all events in a line network.

  • This tool supports conflict prevention and will attempt to acquire and transfer locks.

  • When conflict prevention is enabled, the following are supported:

    • The events whose derived event measures need to be updated will automatically acquire event locks if available. If the locks cannot be acquired, the tool will fail and provide the text file of those locks.

      Learn more about conflict prevention in Pipeline Referencing or conflict prevention in Roads and Highways.

    • While working in the default version, the acquired locks will be released automatically when the tool completes.
    • While working in a child version, the acquired locks will remain in post status when the tool completes. The user must post or delete the version to release the locks.
    • While working in a child version, if the tool run is canceled by interruption, the acquired locks will remain in releasable status.

Parameters

LabelExplanationData Type
Input Route Features

The LRS Network containing the events with the DerivedRouteID field and measure fields configured.

Feature Layer
Update all event feature classes registered in the selected network
(Optional)

Specifies whether all event feature classes in the network will be updated.

  • Checked—All event feature classes in the network that are selected in the Input Route Features parameter value will be updated. This is the default.
  • Unchecked—All event feature classes in the network that are selected in the Input Route Features parameter value will not be updated. Individual event layers can be selected using the Event Layers parameter.
Boolean
Event Layers
(Optional)

The event layers that will have the DerivedRouteID field and measure fields updated.

Feature Layer

Derived Output

LabelExplanationData Type
Output Events

The updated events feature layer.

Feature Layer
Output Details File

The text file that details changes made to the events feature layer.

Note:

Validation results for this tool are written to the ArcGIS Server directory. This file is automatically cleaned up in 10 minutes by default, which may not be enough time to process all of the validations and write them to your workstation that is running ArcGIS Pro. For larger data loads, it is recommended that you adjust the maximum file age to at least one hour.

Text File

arcpy.locref.DeriveEventMeasures(in_route_features, {update_all_events}, {event_layers})
NameExplanationData Type
in_route_features

The LRS Network containing the events with the DerivedRouteID field and measure fields configured.

Feature Layer
update_all_events
(Optional)

Specifies whether all event feature classes in the network will be updated.

  • UPDATE_ALLAll event feature classes in the network that are selected in the in_route_features parameter value will be updated. This is the default.
  • UPDATE_SOMEAll event feature classes in the network that are selected in the in_route_features parameter value will not be updated. Individual event layers can be selected using the event_layers parameter.
Boolean
event_layers
[event_layers,...]
(Optional)

The event layers that will have the DerivedRouteID field and measure fields updated.

Feature Layer

Derived Output

NameExplanationData Type
out_events

The updated events feature layer.

Feature Layer
out_details_file

The text file that details changes made to the events feature layer.

Note:

Validation results for this tool are written to the ArcGIS Server directory. This file is automatically cleaned up in 10 minutes by default, which may not be enough time to process all of the validations and write them to your workstation that is running ArcGIS Pro. For larger data loads, it is recommended that you adjust the maximum file age to at least one hour.

Text File

Code sample

DeriveEventMeasures example 1 (Python window)

The following Python window script demonstrates how to use the DeriveEventMeasures function in immediate mode.

# Name: DeriveEventMeasures_ex1.py
# Description: Populate and update the Derived RouteID and measure values on point and line events with those fields configured and enabled in Python window.
# Requires: ArcGIS Location Referencing

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

# Local variables
in_route_features = "LineNetwork"
update_all_events = "UPDATE_SOME"
event_layers = "Casing, Coating"

# Execute the tool
arcpy.locref.DeriveEventMeasures(in_route_features, update_all_events, event_layers)
DeriveEventMeasures example 2 (stand-alone script)

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

# Name: DeriveEventMeasures_ex2.py
# Description: Populate and update the Derived routeID and measure values on point and line events with those fields configured and enabled in stand-alone script.
# Requirements: ArcGIS Location Referencing

# Import arcpy module
import arcpy

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

# Local variables
in_route_features = r'C:\Data\PipelineReferencing.gdb\LRS\LineNetwork'
update_all_events = "UPDATE_ALL"
event_layers = ""

# Execute the tool
arcpy.locref.DeriveEventMeasures(in_route_features, update_all_events, event_layers)

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

The following stand-alone Python script demonstrates how to use the DeriveEventMeasures function in a feature service.

# Name: DeriveEventMeasures_ex3.py
# Description: Populate and update Derived RouteID and measure values on point and line events with those fields configured and enabled in stand-alone script.
# Requires: ArcGIS Location Referencing

# Import arcpy module.
import arcpy

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

# Input LRS Route Network is in feature service. Portal signin is required to access the feature service.
arcpy.SignInToPortal('https://yourdomain.com/portal', 'username', 'password')

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

# Set tool variables.
update_all_events = "UPDATE_ALL"
event_layers = ""

# Process : Derive Event Measures.
arcpy.locref.DeriveEventMeasures(in_route_features, update_all_events, event_layers)

# Check in 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