Generate Events (Location Referencing)

适用于 Location Referencing 许可。

摘要

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

使用情况

  • 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.

参数

标注说明数据类型
Event Layer

The event for which shapes will be regenerated.

Feature Layer

派生输出

标注说明数据类型
Output Event Layers

Updated events feature layer.

注:

此工具的验证结果将写入 ArcGIS Server 目录。 默认情况下,此文件会在 10 分钟内自动清除,这可能不足以处理所有验证并将其写入正在运行 ArcGIS Pro 的工作站。 对于较大的数据负载,建议您将文件最长保留期限调整为至少一小时。

Feature Layer

arcpy.locref.GenerateEvents(in_event_layer)
名称说明数据类型
in_event_layer

The event for which shapes will be regenerated.

Feature Layer

派生输出

名称说明数据类型
out_event_layers

Updated events feature layer.

注:

此工具的验证结果将写入 ArcGIS Server 目录。 默认情况下,此文件会在 10 分钟内自动清除,这可能不足以处理所有验证并将其写入正在运行 ArcGIS Pro 的工作站。 对于较大的数据负载,建议您将文件最长保留期限调整为至少一小时。

Feature Layer

代码示例

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')

环境

特殊情况

许可信息

  • Basic: 需要 ArcGIS Location Referencing
  • Standard: 需要 ArcGIS Location Referencing
  • Advanced: 需要 ArcGIS Location Referencing

相关主题