Skip To Content

Create LRS Event

Summary

Creates line or point events for an existing LRS Network.

Usage

  • The output of the tool is a feature class.

  • Derived networks cannot be used as parent networks.

  • The event feature class’ fields has properties outlined in the event data model.

  • The following event behavior rules are set by default:

    ActivityRules

    Calibrate Route

    Stay Put

    Reverse Route

    Stay Put

    Retire Route

    Stay Put

    Extend Route

    Stay Put

    Reassign Route

    Stay Put

    Realign Route

    Stay Put

    Realign Overlap

    Stay Put

    Carto Realign Route

    Honor Route Measure

Syntax

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})
ParameterExplanationData Type
parent_network

The network to which the event is registered.

Feature Layer
event_name

The event to be registered.

String
geometry_type
(Optional)

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
(Optional)

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

String
event_spans_routes
(Optional)

Determines if 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
(Optional)

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
(Optional)

Determines if 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
(Optional)

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
(Optional)

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

String

Code sample

CreateLRSEvent example 1 (Python window)

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

# tool variables
parent_network = "C:/data.gdb/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.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)
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: Creates a new event registered to a network
# Requires: ArcGIS Pipeline Referencing 

# Import arcpy module
import arcpy 

# Check out any necessary licenses
arcpy.CheckOutExtension("LocationReferencing")

# Local variables 
parent_network = "C:/data.gdb/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)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • ArcGIS Desktop Basic: Requires ArcGIS Pipeline Referencing
  • ArcGIS Desktop Standard: Requires ArcGIS Pipeline Referencing
  • ArcGIS Desktop Advanced: Requires ArcGIS Pipeline Referencing

Related topics