Derive Event Measures (Location Referencing)

Title  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


Syntax

Parameter Explanation
in_route_features

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

update_all_events (Optional)

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

  • Checked—Updates all events in the network selected in Input Route Features. This is the default.
  • Unchecked—Does not update all events in the network selected in Input Route Features. Allows the user to select individual event layers in the event layers parameter below.
event_layers (Optional)

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

Code Samples

DeriveEventMeasures example 1 (Python window)

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


# Import arcpy module
import arcpy

# Local variables
in_route_features = r'C:\Data\PipelineReferencing.gdb\LineNetwork'
update_all_events = "UPDATE_SOME"
event_layers = "Casing, Coating"

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

# Execute the tool
arcpy.DeriveEventMeasures_locref(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 tool.


# Name: DeriveEventMeasures_ex2.py
# Description: Populates/Updates the Derived RouteID and measure values on point and line events with those fields configured and enabled.
# 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'
update_all_events = "UPDATE_ALL"
event_layers = ""

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

                    

DeriveEventMeasures example 3 (stand-alone script)

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


# Name: DeriveEventMeasures_Pro_Ex3.py
# Description: This script demonstrates how to use derive event measures in stand alone mode using 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 route network from the feature service. Here, 3 corresponds to the input route network.
in_lrs_network = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/3"

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


# Process : Derive Event Measures.
arcpy.DeriveEventMeasures_locref(in_lrs_network, update_all_events, event_layers)

                    

Tags

Credits

Use limitations