Transform Route Events (Linear Referencing)

Summary

Transforms the measures of events from one route reference to another and writes them to a new event table.

Usage

  • Transforming events allows you to use the events from one route reference with another route reference having different route identifiers, measures, or both.

  • Any whole or partial event that intersects a target route is written to the new event table.

  • The best results will be achieved when the source routes and the target routes closely overlay.

    Caution:

    Using a large Cluster Tolerance parameter value to overcome discrepancies between the source and target routes can produce unexpected results.

  • The Event Type value (Point or Line) must match the input event type.

  • Use the Make Table View tool prior to this tool to effectively reduce the number of events that will be processed.

  • The output table can be displayed in a map using the Make Route Event Layer tool.

Parameters

LabelExplanationData Type
Input Event Table

The input event table.

Table View
Event Table Properties

The route location fields and the type of events in the input event table.

  • Route Identifier Field—The field containing values that indicate the route on which each event is located. This field can be a numeric, text, or GUID field.
  • Event Type—The type of events in the input event table (Point or Line).
    • Point—Point events occur at a precise location along a route. Only a from-measure field must be specified.
    • Line—Line events define a portion of a route. Both from- and to-measure fields must be specified.
  • From-Measure Field—A field containing measure values. This field must be numeric and is required when the event type is Point or Line. When the Event Type value is Point, the label for this parameter becomes Measure Field.
  • To-Measure Field—A field containing measure values. This field must be numeric and is required when the event type is Line.
Route Measure Event Properties
Source Route Features

The input route features.

Feature Layer
Source Route Identifier Field

The field containing values that uniquely identify each input route. The field can be a numeric, text, or GUID field.

Field
Target Route Features

The route features to which the input events will be transformed.

Feature Layer
Target Route Identifier Field

The field containing values that uniquely identify each target route. The field can be a numeric, text, or GUID field.

Field
Output Event Table

The table that will be created.

Table
Output Event Table Properties

The route location fields and the type of events that will be written to the output event table.

  • Route Identifier Field—The field that will contain values that indicate the route on which each event is located. The field can be a numeric, text, or GUID field.
  • Event Type—The type of events the output event table will contain (Point or Line).
    • Point—Point events occur at a precise location along a route. Only a single measure field must be specified.
    • Line—Line events define a portion of a route. Both from- and to-measure fields must be specified.
  • From-Measure Field—A field that will contain measure values. This field is required when the event type is Point or Line. When the Event Type value is Point, the label for this parameter becomes Measure Field.
  • To-Measure Field—A field that will contain measure values. This field is required when the event type is Line.
Route Measure Event Properties
Cluster Tolerance

The maximum tolerated distance between the input events and the target routes.

Linear Unit
Include all fields from input
(Optional)

Specifies whether the Output Event Table parameter value will contain route location fields plus all the attributes from the input events.

  • Checked—The Output Event Table parameter value will contain route location fields plus all the attributes from the input events. This is the default.
  • Unchecked—The Output Event Table parameter value will only contain route location fields plus the ObjectID field from the input events.
Boolean

arcpy.lr.TransformRouteEvents(in_table, in_event_properties, in_routes, route_id_field, target_routes, target_route_id_field, out_table, out_event_properties, cluster_tolerance, {in_fields})
NameExplanationData Type
in_table

The input event table.

Table View
in_event_properties

The route location fields and the type of events in the input event table.

  • Route identifier field—The field containing values that indicate the route on which each event is located. This field can be a numeric, text, or GUID field.
  • Event type—The type of events in the input event table (POINT or LINE).
    • POINT—Point events occur at a precise location along a route. Only a from-measure field must be specified.
    • LINE—Line events define a portion of a route. Both from- and to-measure fields must be specified.
  • From-measure field—A field containing measure values. This field must be numeric and is required when the event type is POINT or LINE
  • To-measure field—A field containing measure values. This field must be numeric and is required when the event type is LINE.
Route Measure Event Properties
in_routes

The input route features.

Feature Layer
route_id_field

The field containing values that uniquely identify each input route. The field can be a numeric, text, or GUID field.

Field
target_routes

The route features to which the input events will be transformed.

Feature Layer
target_route_id_field

The field containing values that uniquely identify each target route. The field can be a numeric, text, or GUID field.

Field
out_table

The table that will be created.

Table
out_event_properties

The route location fields and the type of events that will be written to the output event table.

  • Route identifier field—The field that will contain values that indicate the route on which each event is located. The field can be a numeric, text, or GUID field.
  • Event type—The type of events the output event table will contain (POINT or LINE).
    • POINT—Point events occur at a precise location along a route. Only a single measure field must be specified.
    • LINE—Line events define a portion of a route. Both from- and to-measure fields must be specified.
  • From-measure field—A field that will contain measure values. This field is required when the event type is POINT or LINE.
  • To-measure field—A field that will contain measure values. This field is required when the event type is LINE.
Route Measure Event Properties
cluster_tolerance

The maximum tolerated distance between the input events and the target routes.

Linear Unit
in_fields
(Optional)

Specifies whether the out_table parameter value will contain route location fields plus all the attributes from the input events.

  • FIELDSThe out_table parameter value will contain route location fields plus all the attributes from the input events. This is the default.
  • NO_FIELDSThe out_table parameter value will only contain route location fields plus the ObjectID field from the input events.
Boolean

Code sample

TransformRouteEvents example 1 (Python window)

The following Python window script demonstrates how to use the TransformRouteEvents function:


import arcpy
arcpy.env.workspace = "C:/Data"
arcpy.lr.TransformRouteEvents("pavement.dbf", "route1 LINE begin_mp end_mp", 
                              "hwy.shp", "route1", "hwy_new.shp", "route1", 
                              "trans_out1.dbf", "route1 LINE fmp tmp", "0.1 meters")
TransformRouteEvents example 2 (stand-alone script)

The following demonstrates how to use the TransformRouteEvents function in a stand-alone Python script using file geodatabase data:

# Name: TransformRouteEvents_Example2.py
# Description: Transform point events (input table is in a file geodatabase)

# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "C:/Data/pitt.gdb"

# Set local variables
in_tbl = "accident"
in_props = "route1 POINT measure"
in_rt = "roads/hwy"               # hwy exists in the roads feature dataset 
in_rid = "route1" 
target_rt = "roads/hwy_new"       # hwy_new exists in the roads feature dataset 
target_rid = "route1" 
out_tbl = "trans_out2"
out_props = "route1 POINT mp"
tol = "0.1 meters"  

# Run TransformRouteEvents
arcpy.lr.TransformRouteEvents(in_tbl, in_props, in_rt, in_rid, target_rt, 
                              target_rid, out_tbl, out_props, tol)
TransformRouteEvents example 3 (stand-alone script)

The following demonstrates how to use the TransformRouteEvents function in a stand-alone Python script using enterprise geodatabase data:

# Name: TransformRouteEvents_Example3.py
# Description: Transform point events (input table is in an enterprise geodatabase)

# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "C:/MyProject/myConn.sde"

# Set local variables
in_tbl = arcpy.ValidateTableName("accident", wkspc) 
in_props = "route1 POINT measure"
in_rt = arcpy.ValidateTableName("hwy", wkspc) 
in_rid = "route1" 
target_rt = arcpy.ValidateTableName("hwy_new", wkspc) 
target_rid = "route1" 
out_tbl = "trans_out3"
out_props = "route1 POINT mp"
tol = "0.1 meters"  

# Run TransformRouteEvents
arcpy.lr.TransformRouteEvents(in_tbl, in_props, in_rt, in_rid, target_rt, 
                              target_rid, out_tbl, out_props, tol)

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics