Skip To Content

Modify LRS Event

Summary

Modifies properties of a linear referencing system (LRS) event.

Usage

  • Modified fields should have the properties outlined in the event data model.

  • This tool can be used to add or remove the following properties from an event:

    Present Event for a Continuous Network

    Event typeSupports route nameSupports spanning routes

    Line

    No

    N/A

    Line

    Yes

    N/A

    Point

    No

    N/A

    Point

    Yes

    N/A

    Modified Event for a Continuous Network

    Event typeSupports route nameSupports spanning routes

    Line

    Yes

    N/A

    Line

    No

    N/A

    Point

    Yes

    N/A

    Point

    No

    N/A

    Present Event for an Engineering Network

    Event typeSupports route nameSupports spanning routes

    Line

    No

    No

    Line

    Yes

    No

    Line

    Yes

    No

    Line

    Yes

    Yes

    Point

    No

    N/A

    Point

    Yes

    N/A

    Modified Event for an Engineering Network

    Event typeSupports route nameSupports spanning routes

    Line

    Yes

    No

    Line

    No

    No

    Line

    Yes

    Yes

    Line

    Yes

    No

    Point

    Yes

    N/A

    Point

    No

    N/A

Syntax

ModifyLRSEvent_locref (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
in_feature_class

The input feature class or feature layer for the event.

Feature Layer
event_id_field

Name of the event ID field.

Field
route_id_field

Name of the route ID field.

Field
from_date_field

Name of the from date field.

Field
to_date_field

Name of the to date field.

Field
loc_error_field

Name of the location error field.

Field
measure_field

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

Field
to_measure_field
(Optional)

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

Field
event_spans_routes
(Optional)

Determines if the event records will span routes.

  • AS_ISNo change to the property. This is the default.
  • NO_SPANS_ROUTESThe event records do not span routes. Applicable only for line events.
  • SPANS_ROUTES The event records may span routes. Applicable only for line events.
String
to_route_id_field
(Optional)

Name of the to route ID field. Required only if it is a line event and it spans routes.

Field
store_route_name
(Optional)

Determines if the event records will store the route name.

  • AS_ISNo change to the property. This is the default.
  • STORE_ROUTE_NAMEStores the route name with the event records.
  • NO_STORE_ROUTE_NAMEDoes not store the route name with the event records.
String
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.

Field
to_route_name_field
(Optional)

Name of the to route name field. Required if it is a line event, and store_route_name and SPANS_ROUTES are set.

Field

Code sample

ModifyLRSEvent example 1 (Python window)

The following script demonstrates how to use the ModifyLRSEvent tool in a Python window for the events to span routes.

# tool variables
in_feature_class = "c:/data.gdb/Event1"
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.ModifyLRSEvent_locref(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)
ModifyLRSEvent example 2 (stand-alone script)

The following script demonstrates how to use the ModifyLRSEvent tool in a stand-alone Python script so that the events span routes.

# Name: Modify_LRS_Event_ex2.py
# Description: Modifies an event registered to a network so that it spans routes
# Requires: ArcGIS Pipeline Referencing

# Import arcpy module
import arcpy

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

# Local variables:
in_feature_class = r"C:/data.gdb/Event1"
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:  Modify LRS Event From Existing Dataset
arcpy.ModifyLRSEvent_locref(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