Make Route Event Layer (Linear Referencing)

Summary

Creates a temporary feature layer using routes and route events.

When the temporary layer is used (displayed on a map or used by another geoprocessing tool), dynamic segmentation is performed.

Usage

  • The input table can be any type of table ArcGIS supports.

  • Use the Make Feature Layer tool on the routes and/or the Make Table View tool on the events to reduce the number of routes and events that will be processed before running this tool.

  • Not all types of tables have an Object ID field. When tables with no Object ID field are used by this tool, the resulting layer will not be selectable and cannot be used effectively by certain geoprocessing operations. You can use the Make Query Table tool to add a virtual Object ID field before running this tool.

Parameters

LabelExplanationData Type
Input Route Features

The route features on which events will be located.

Feature Layer
Route Identifier Field

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

Field
Input Event Table

The table whose rows will be located along routes.

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
Layer Name or Table View

The layer that will be created. This layer is stored in memory, so a path is not necessary.

Feature Layer
Offset Field
(Optional)

The field containing the values that will be used to offset events from their underlying route. This field must be numeric.

Field
Generate a field for locating errors
(Optional)

Specifies whether a LOC_ERROR field will be added to the temporary layer that is created.

  • Unchecked—A field to store locating errors will not be added. This is the default.
  • Checked—A field to store locating errors will be added.
Boolean
Generate an angle field
(Optional)

Specifies whether a LOC_ANGLE field will be added to the temporary layer that is created. This parameter is only valid when the event type is point.

  • Unchecked—A field to store locating angles will not be added. This is the default.
  • Checked—A field to store locating angles will be added.
Boolean
Calculated Angle Type
(Optional)

Specifies the type of locating angle that will be calculated. This parameter is only valid if Generate an angle field is checked.

  • NormalThe normal (perpendicular) angle will be calculated. This is the default.
  • TangentThe tangent angle will be calculated.
String
Write the complement of the angle to the angle field
(Optional)

Specifies whether the complement of the locating angle will be written. This parameter is only valid if Generate an angle field is checked.

  • Unchecked—The complement of the angle will not be written. Only the calculated angle will be written. This is the default.
  • Checked—The complement of the angle will be written.
Boolean
Events with a positive offset will be placed to the right of the routes
(Optional)

Specifies the side on which the route events with a positive offset will be displayed. This parameter is only valid if an offset field has been specified.

  • Unchecked—Events with a positive offset will be displayed to the left of the route. The side of the route is determined by the measures and not necessarily the digitized direction. This is the default.
  • Checked—Events with a positive offset will be displayed to the right of the route. The side of the route is determined by the digitized direction.
Boolean
Point events will be generated as multipoint features
(Optional)

Specifies whether point events will be treated as point features or multipoint features.

  • Unchecked—Point events will be treated as point features. This is the default.
  • Checked—Point events will be treated as multipoint features.
Boolean

arcpy.lr.MakeRouteEventLayer(in_routes, route_id_field, in_table, in_event_properties, out_layer, {offset_field}, {add_error_field}, {add_angle_field}, {angle_type}, {complement_angle}, {offset_direction}, {point_event_type})
NameExplanationData Type
in_routes

The route features on which events will be located.

Feature Layer
route_id_field

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

Field
in_table

The table whose rows will be located along routes.

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
out_layer

The layer that will be created. This layer is stored in memory, so a path is not necessary.

Feature Layer
offset_field
(Optional)

The field containing the values that will be used to offset events from their underlying route. This field must be numeric.

Field
add_error_field
(Optional)

Specifies whether a LOC_ERROR field will be added to the temporary layer that is created.

  • NO_ERROR_FIELDA field to store locating errors will not be added. This is the default.
  • ERROR_FIELDA field to store locating errors will be added.
Boolean
add_angle_field
(Optional)

Specifies whether a LOC_ANGLE field will be added to the temporary layer that is created. This parameter is only valid when the event type is point.

  • NO_ANGLE_FIELDA field to store locating angles will not be added. This is the default.
  • ANGLE_FIELDA field to store locating angles will be added.
Boolean
angle_type
(Optional)

Specifies the type of locating angle that will be calculated. This parameter is only valid if add_angle_field = "ANGLE_FIELD".

  • NORMALThe normal (perpendicular) angle will be calculated. This is the default.
  • TANGENTThe tangent angle will be calculated.
String
complement_angle
(Optional)

Specifies whether the complement of the locating angle will be written. This parameter is only valid if add_angle_field = "ANGLE_FIELD".

  • ANGLEThe complement of the angle will not be written. Only the calculated angle will be written. This is the default.
  • COMPLEMENTThe complement of the angle will be written.
Boolean
offset_direction
(Optional)

Specifies the side on which the route events with a positive offset will be displayed. This parameter is only valid if an offset field has been specified.

  • LEFTEvents with a positive offset will be displayed to the left of the route. The side of the route is determined by the measures and not necessarily the digitized direction. This is the default.
  • RIGHTEvents with a positive offset will be displayed to the right of the route. The side of the route is determined by the digitized direction.
Boolean
point_event_type
(Optional)

Specifies whether point events will be treated as point features or multipoint features.

  • POINTPoint events will be treated as point features. This is the default.
  • MULTIPOINTPoint events will be treated as multipoint features.
Boolean

Code sample

MakeRouteEventLayer example 1 (Python window)

import arcpy
arcpy.env.workspace = "C:/Data"
arcpy.lr.MakeRouteEventLayer("route_hwy.shp", "rkey", "accident.dbf", 
                             "rkey POINT mile", "accident_events", "#", 
                             "ERROR_FIELD", "ANGLE_FIELD")
MakeRouteEventLayer example 2 (stand-alone script)

The following Python script demonstrates how to use the MakeRouteEventLayer function in a stand-alone Python script.

# Name: MakeRouteEventLayer_Example2.py
# Description:  Make a POINT event layer. Routes and events are in a shapefile workspace.
# An error field and an angle field are added to the new layer. The new layer can be used
# by other geoprocessing functions.

# Import system modules
import arcpy

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

# Set local variables
rt = "route_hwy.shp"
rid = "rkey" 
tbl = "accident.dbf"
props = "rkey POINT mile"
lyr = "accident_events" 

# Run MakeRouteEventLayer
arcpy.lr.MakeRouteEventLayer(rt, rid, tbl, props, lyr, "#", "ERROR_FIELD", 
                             "ANGLE_FIELD")
MakeRouteEventLayer example 3 (stand-alone script)

The following Python script demonstrates how to use the MakeRouteEventLayer function in a stand-alone Python script.

# Name: MakeRouteEventLayer_Example3.py
# Description:  Make a LINE event layer. Routes and events are in a file geodatabase.
# An error field is added to the new layer. The new layer can be used by other 
# geoprocessing functions.

# Import system modules 
import arcpy

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

# Set local variables
rt = "roads/hwy"  # the 'hwy' feature class is in the 'roads' feature dataset
rid = "rkey" 
tbl = "pavecond"
props = "rkey LINE fmp tmp"
lyr = "pave_events" 

# Run MakeRouteEventLayer
arcpy.lr.MakeRouteEventLayer(rt, rid, tbl, props, lyr, "#", "ERROR_FIELD")
MakeRouteEventLayer example 4 (stand-alone script)

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

# Name: MakeRouteEventLayer_Example4.py
# Description: Make a POINT event layer. Routes and events are in an enterprise geodatabase.
# The new layer can be used by other geoprocessing functions.

# Import system modules 
import arcpy

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

# Set local variables
ds = arcpy.ValidateTableName("roads", wkspc)  # the 'roads' feature dataset
fc = arcpy.ValidateTableName("hwy", wkspc)  # the 'hwy' feature class 
rt = ds + "/" + fc  # the 'hwy' feature class is in the 'roads' feature dataset
rid = "rkey" 
tbl = "accident"
props = "rkey POINT mile"
lyr = "accident_events2" 

# Run MakeRouteEventLayer
arcpy.lr.MakeRouteEventLayer(rt, rid, tbl, props, lyr)

Licensing information

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

Related topics