Generate Events (Location Referencing)

Available with Location Referencing license.

Summary

Re-creates shapes for event features registered with an LRS Network.

Usage

  • An LRS dataset is required to run this tool. To create an LRS dataset, add the calibration point, centerline, and redline layers to a feature dataset; then run the Modify LRS tool with the geodatabase as the input.

  • Input the event whose features need to be regenerated based on the route and measure of the event.

  • When conflict prevention is enabled for the tool, any events being generated by the tool will be locked.

    • While working in the default version, the locks acquired are released automatically when the tool completes.
    • While working in a child version, the locks acquired will remain in On Post status when the tool completes. The lock owner must post or delete the version to release the locks.
    • While working in a child version, if the execution of the tool is canceled by interruption, the locks are acquired and will remain in releasable status when the tool completes.

Syntax

GenerateEvents(in_event_layer)
ParameterExplanationData Type
in_event_layer

The event for which shapes will be regenerated.

Feature Layer

Derived Output

NameExplanationData Type
out_event_layers

Updated events feature layer.

Feature Layer

Code sample

GenerateEvents example 1 (Python window)

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

# Name: GenerateEvents_Ex1.py
# Description: Generate events in stand-alone mode using a feature service. It is recommended to work in  a version and post it into the default version.
# Requires: ArcGIS Location Referencing

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

# Tool variables 
in_event_layer = "Event"

# Set current workspace 
arcpy.env.workspace = "C:/data/Outputs.gdb"

# Execute the tool 
arcpy.GenerateEvents_locref(in_event_layer)

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

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

# Name: GenerateEvents_Ex2.py 
# Description: Re-creates shapes for event features registered with an LRS Network 
# Requirements: ArcGIS Location Referencing

# Import arcpy module 
import arcpy

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

# Local variables 
# Input Network layer 
in_event_layer = "C:\\Data\Sample.gdb\\LRS\\SpeedLimit" 

# Process: Generate Events
arcpy.GenerateEvents_locref(in_event_layer)

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

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

# Name: GenerateEvents_Ex3.py
# Description: Generate events in stand-alone mode using a feature service. It is recommended to work in  a version and post it into the default version.
# Requires: ArcGIS Location Referencing

# Import arcpy module.
import arcpy

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

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

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

# Process : Generate Events
arcpy.GenerateEvents_locref(in_event_layer)

# Check in license
arcpy.CheckInExtension('LocationReferencing')

Environments

Licensing information

  • Basic: Requires ArcGIS Location Referencing
  • Standard: Requires ArcGIS Location Referencing
  • Advanced: Requires ArcGIS Location Referencing

Related topics