Make Route Event Layer (Linear Referencing)

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 tips

Syntax

MakeRouteEventLayer_lr (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)
Parameter Explanation Datatype
Input Route Features (Required)

The route features upon which events will be located.

Feature Layer
Route Identifier Field (Required)

The field containing values that uniquely identify each route.

Field
Input Event Table (Required)

The table whose rows will be located along routes.

Table View
Event Table Properties (Required)

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

Route Identifier Field—The field containing values that indicate which route each event is along. This field can be numeric or character.

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. Note, when the Event Type 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 (Required)

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

Feature Layer
Offset Field (Optional)

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

Field
Generate a field for locating errors (Optional)

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

  • NO_ERROR_FIELD—Do not add a field to store locating errors. This is the default.
  • ERROR_FIELD—Add a field to store locating errors.

Boolean
Generate an angle field (Optional)

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

  • NO_ANGLE_FIELD—Do not add a field to store locating angles. This is the default.
  • ANGLE_FIELD—Add a field to store locating angles.

Boolean
Calculated Angle Type (Optional)

Specifies the type of locating angle that will be calculated. This parameter is only valid if ANGLE_FIELD has been specified.

  • NORMAL—The normal (perpendicular) angle will be calculated. This is the default.
  • TANGENT—The 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 calculated. This parameter is only valid if ANGLE_FIELD has been specified.

  • ANGLE—Do not write the complement of the angle. Write only the calculated angle. This is the default.
  • COMPLEMENT—Write the complement of the angle.

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 are displayed. This parameter is only valid if an offset field has been specified.

  • LEFT—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.
  • RIGHT—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.

  • POINT—Point events will be treated as point features. This is the default.
  • MULTIPOINT—Point events will be treated as multipoint features.

Boolean
Data types for geoprocessing tool parameters

Script Example

# Example 1:
#   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 arcgisscripting, constants
gp = arcgisscripting.create()
try:
    gp.Workspace = "D:/Data/pitt_county"
    rt = "route_hwy.shp"
    rid = "rkey" 
    tbl = "accident.dbf"
    props = "rkey POINT mile"
    lyr = "accident_events" 
    gp.MakeRouteEventLayer_lr (rt, rid, tbl, props, lyr, "#",  "ERROR_FIELD",  "ANGLE_FIELD") 
except:
    print gp.GetMessages(2)


# Example 2:
#   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 arcgisscripting, constants
gp = arcgisscripting.create()
try:
    gp.Workspace = "D:/Data/pitt_county/pitt.gdb"
    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" 
    gp.MakeRouteEventLayer_lr (rt, rid, tbl, props, lyr, "#",  "ERROR_FIELD")
except:
    print gp.GetMessages(2)


# Example 3:
#   Make a LINE event layer. Routes and events are in a personal geodatabase.
#   An error field is added to the new layer. The new layer can be used by other 
#   geoprocessing functions.

import arcgisscripting, constants
gp = arcgisscripting.create()
try:
    gp.Workspace = "D:/Data/pitt_county/pitt.mdb"
    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" 
    gp.MakeRouteEventLayer_lr (rt, rid, tbl, props, lyr, "#",  "ERROR_FIELD")
except:
    print gp.GetMessages(2)


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

import arcgisscripting, constants
gp = arcgisscripting.create()
try:
    wkspc = "Database Connections/Connection to Jerry.sde"
    gp.Workspace = wkspc 
    ds = gp.QualifyTableName("roads", wkspc)          # the 'roads' feature dataset
    fc = gp.QualifyTableName("hwy", wkspc)            # the 'hwy' feature class 
    rt = ds + "/" + fc #the 'hwy' feature class is in the 'roads' feature dataset
    rid = "rkey" 
    tbl = gp.QualifyTableName("accident", wkspc)
    props = "rkey POINT mile"
    lyr = "accident_events2" 
    gp.MakeRouteEventLayer_lr (rt, rid, tbl, props, lyr) 
except:
    print gp.GetMessages(2)

See Also

  • Adding route events
  • Dissolve Route Events (Linear Referencing)
  • Dynamic segmentation
  • Locate Features Along Routes (Linear Referencing)