Skip To Content

Create LRS Event From Existing Dataset

Summary

Registers an existing feature class as an event.

Usage

  • The event feature class should not contain any features.

  • The event feature class’ fields should have the 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

CreateLRSEventFromExistingDataset_locref (parent_network, in_feature_class, 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 will be registered.

Feature Layer
in_feature_class

The event to be registered.

Feature Layer
event_id_field

The event ID field in the event feature class.

Field
route_id_field

The route ID field if the feature class is a point event or from route ID field if the feature class is a line event and event_spans_routes is set to SPANS_ROUTES.

Field
from_date_field

The from date field in the event feature class.

Field
to_date_field

The to date field in the event feature class.

Field
loc_error_field

The location error field in the event feature class.

Field
measure_field

The measure field if the feature class is a point event, or from measure field if the feature class is a line event.

Field
to_measure_field
(Optional)

The to measure field in the event feature class. Required for line events.

Field
event_spans_routes
(Optional)

Determines if the event records will span routes.

  • NO_SPANS_ROUTESThe event records do not span routes. This is the default.
  • SPANS_ROUTES The event records may span routes.
Boolean
to_route_id_field
(Optional)

The to route ID field for events that span routes. Required if in_feature class geometry type is polyline and event_span_routes is set to SPANS_ROUTES.

Field
store_route_name
(Optional)

Determines if the route name should be stored with the event records.

  • NO_STORE_ROUTE_NAME Does not store the route name with the event records. This is the default.
  • STORE_ROUTE_NAME Stores the route name with the event records.
Boolean
route_name_field
(Optional)

The route name field if the feature class is a point event that doesn't span routes, or the from route name field if the feature class is a line event that spans routes. Required if STORE_ROUTE_NAME is set.

Field
to_route_name_field
(Optional)

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

Field

Code sample

CreateLRSEventFromExistingDataset example 1 (Python window)

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

# tool variables
parent_network = "C:/data.gdb/Network"
in_feature_class = "C:/data.gdb/Event"
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.CreateLRSEventFromExistingDataset_locref(parent_network, in_feature_class, 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)
CreateLRSEventFromExistingDataset example 2 (stand-alone script)

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

# Name: Create_LRS_Event_From_Existing_Dataset _ex2.py
# Description: Registers an existing feature class as an event.
# Requires: ArcGIS Pipeline Referencing 

# Import arcpy module
import arcpy 

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

# Local variables 
parent_network = r"C:/data.gdb/Network"
in_feature_class = r"C:/data.gdb/Event"
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.CreateLRSEventFromExistingDataset_locref(parent_network, in_feature_class, 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