Generate Events (Location Referencing)

Available with Location Referencing license.

Summary

Regenerates shapes for event features registered with an LRS Network.

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 .

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

  • 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 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 remain in releasable status when the tool completes.

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

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

Parameters

LabelExplanationData Type
Event Layer

The event for which shapes will be regenerated.

Feature Layer

Derived Output

LabelExplanationData Type
Output Event Layers

The updated 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 the 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.

Feature Layer
Output Results File

A text file that details changes made by the tool.

Text File

arcpy.locref.GenerateEvents(in_event_layer)
NameExplanationData Type
in_event_layer

The event for which shapes will be regenerated.

Feature Layer

Derived Output

NameExplanationData Type
out_event_layers

The updated 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 the 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.

Feature Layer
out_details_file

A text file that details changes made by the tool.

Text File

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 immediate mode.

# Tool variables 
in_event_layer = "Event"

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

# Execute the tool 
arcpy.locref.GenerateEvents(in_event_layer)
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.locref.GenerateEvents(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.locref.GenerateEvents(in_event_layer)

# 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