Create LRS Event (Location Referencing)

摘要

Creates line or point events for an existing LRS Network.

使用情况

  • The output of the tool is a feature class.

  • Derived networks cannot be used as parent networks.

  • The event feature class fields have properties outlined in the ArcGIS Pipeline Referencing events data model and in the ArcGIS Roads and Highways events data model.

  • The following event behavior rules are set by default:

    ActivityRules

    Calibrate Route

    Stay Put

    Retire Route

    Stay Put

    Extend Route

    Stay Put

    Reassign Route

    Stay Put

    Realign Route

    Stay Put

    Carto Realign Route

    Honor Route Measure

参数

标注说明数据类型
Parent LRS Network

The network to which the event is registered.

Feature Layer
Event Name

The event to be registered.

String
Geometry Type
(可选)

The geometry type of the output event.

  • PointThe geometry type of the event is Point. This is the default.
  • LineThe geometry type of the event is Polyline.
String
Event ID Field

The event ID field available in the event feature class.

String
Route ID Field

Name of the route ID field if it is a point event that does not span routes, or from route ID field if the event spans routes. The field is available in the event feature class.

String
From Date Field

The from date field available in the event feature class.

String
To Date Field

The to date field available in the event feature class.

String
Location Error Field

The location error field available in the event feature class.

String
Measure Field

Name of the measure field if it is a point event or from measure field if it is a line event.

String
To Measure Field
(可选)

Name of the to measure field. Required only for Line events.

String
Event Spans Routes
(可选)

Specifies whether the event records spans routes.

  • Checked—The event records span routes.
  • Unchecked—The event records do not span routes. This is the default.
Boolean
To Route ID Field
(可选)

Name of the to route ID field. Required only if the geometry type is a line and the Event Spans Routes check box is checked.

String
Store Route Name
(可选)

Specifies whether the route name should be stored with the event records.

  • Checked—Stores route name with the event records.
  • Unchecked—Does not store route name with the event records. This is the default.
Boolean
Route Name Field
(可选)

The route name field if it is a point event that does not span routes, or the from route name field if it is a line event that spans routes. Required if Store Route Name is checked.

String
To Route Name Field
(可选)

The to route name field for line events that span routes. Required if Store Route Name is checked.

String

派生输出

标注说明数据类型
Output Event Feature Class

The updated event feature layer.

Feature Layer

arcpy.locref.CreateLRSEvent(parent_network, event_name, {geometry_type}, event_id_field, route_id_field, from_date_field, to_date_field, loc_error_field, measure_field, {to_measure_field}, {event_spans_routes}, {to_route_id_field}, {store_route_name}, {route_name_field}, {to_route_name_field})
名称说明数据类型
parent_network

The network to which the event is registered.

Feature Layer
event_name

The event to be registered.

String
geometry_type
(可选)

The geometry type of the output event.

  • POINTThe geometry type of the event is Point. This is the default.
  • LINEThe geometry type of the event is Polyline.
String
event_id_field

The event ID field available in the event feature class.

String
route_id_field

Name of the route ID field if it is a point event that does not span routes, or from route ID field if the event_spans_routes parameter is set to SPANS_ROUTES.

String
from_date_field

The from date field available in the event feature class.

String
to_date_field

The to date field available in the event feature class.

String
loc_error_field

The location error field available in the event feature class.

String
measure_field

Name of the measure field if it is a point event or from measure field if it is a line event.

String
to_measure_field
(可选)

Name of the to measure field. Required only for Line events.

String
event_spans_routes
(可选)

Specifies whether the event records spans routes.

  • SPANS_ROUTESThe event records span routes.
  • NO_SPANS_ROUTESThe event records do not span routes. This is the default.
Boolean
to_route_id_field
(可选)

Name of the to route ID field. Required only if the geometry_type parameter is set to LINE and the event_span_routes parameter is set to SPANS_ROUTES.

String
store_route_name
(可选)

Specifies whether the route name should be stored with the event records.

  • STORE_ROUTE_NAMEStores the route name with the event records.
  • NO_STORE_ROUTE_NAMEDoes not store the route name with the event records. This is the default.
Boolean
route_name_field
(可选)

The route name field if it is a point event that does not span routes, or the from route name field if it is a line event that spans routes. Required if STORE_ROUTE_NAME is set.

String
to_route_name_field
(可选)

The to route name field for line events that span routes. Required if STORE_ROUTE_NAME is set.

String

派生输出

名称说明数据类型
out_feature_class

The updated event feature layer.

Feature Layer

代码示例

CreateLRSEvent example 1 (Python window)

The following script demonstrates how to use the CreateLRSEvent tool in the Python window.

# Name: Create_LRS_Event_ex1.py
# Description: Create a new LRS Event registered to an LRS Network in the Python window.
# Requires: ArcGIS Location Referencing 

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

# Tool variables
parent_network = r"C:/data.gdb/LRS/Network"
event_name = "Event1"
geometry_type = "LINE"
event_id_field = "EventID"
route_id_field = "FromRouteId"
from_date_field = "FromDate"
to_date_field = "ToDate"
loc_error_field = "LocationError"
measure_field = "FromMeasure"
to_measure_field = "ToMeasure"
event_spans_routes = "SPANS_ROUTES"
to_route_id_field = "ToRouteId"
store_route_name = "STORE_ROUTE_NAME"
route_name_field = "FromRouteName"
to_route_name_field = "ToRouteName"

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

# execute the tool
arcpy.locref.CreateLRSEvent(parent_network, event_name, geometry_type, event_id_field, route_id_field, from_date_field,
                            to_date_field, loc_error_field, measure_field, to_measure_field, event_spans_routes,
                            to_route_id_field, store_route_name, route_name_field, to_route_name_field)

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

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

# Name: Create_LRS_Event_ex2.py
# Description: Create a new LRS Event registered to an LRS Network in this stand-alone script.
# Requires: ArcGIS Location Referencing 

# Import arcpy module
import arcpy 

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

# Local variables 
parent_network = r"C:/data.gdb/LRS/Network"
event_name = "Event1"
geometry_type = "LINE"
event_id_field = "EventID"
route_id_field = "FromRouteId"
from_date_field = "FromDate"
to_date_field = "ToDate"
loc_error_field = "LocationError"
measure_field = "FromMeasure"
to_measure_field = "ToMeasure"
event_spans_routes = "SPANS_ROUTES"
to_route_id_field = "ToRouteId"
store_route_name = "STORE_ROUTE_NAME"
route_name_field = "FromRouteName"
to_route_name_field = "ToRouteName"

# Process:  Create LRS Event From Existing Dataset
arcpy.CreateLRSEvent_locref(parent_network, event_name, geometry_type, event_id_field, route_id_field, from_date_field,
                            to_date_field, loc_error_field, measure_field, to_measure_field, event_spans_routes,
                            to_route_id_field, store_route_name, route_name_field, to_route_name_field)

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

环境

此工具不使用任何地理处理环境。

许可信息

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

相关主题