Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Linear Referencing toolbox > Tools

Locate Features Along Routes (Linear Referencing)

Release 9.2
Last modified November 9, 2006
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

Computes the intersection of input features (point, line, or polygon) and route features and writes the route and measure information to a new event table.


Usage tips

Command line syntax
An overview of the Command Line window
LocateFeaturesAlongRoutes_lr <in_features> <in_routes> <route_id_field> <radius_or_tolerance> <out_table> <out_event_properties> {FIRST | ALL} {DISTANCE | NO_DISTANCE} {ZERO | NO_ZERO} {FIELDS | NO_FIELDS}

Parameter Explanation Data Type
<in_features>

The input point, line, or polygon features.

Feature Layer
<in_routes>

The routes with which the input features will be intersected.

Feature Layer
<route_id_field>

The field containing values that uniquely identify each route. This field can be numeric or character.

Field
<radius_or_tolerance>

If the input features are points, the search radius is a numeric value defining how far around each point a search will be done to find a target route.

If the input features are lines, the search tolerance is really a cluster tolerance, which is a numeric value representing the maximum tolerated distance between the input lines and the target routes.

If the input features are polygons, this parameter is ignored since no search radius is used.

Linear unit
<out_table>

The table to be created.

Table
<out_event_properties>

Parameter consisting of 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 which route each event is along.

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 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 that will contain measure values. Required when the event type is POINT or LINE.

To-Measure Field — A field that will contain measure values. Required when the event type is LINE.

Route Measure Event Properties
{FIRST | ALL}

When locating points along routes, it is possible that more than one route may be within the search radius of any given point. This parameter is ignored when locating lines or polygons along routes.

  • FIRST — Only the closest route location will be written to the output event table. This is the default.
  • ALL — Every route location (within the search radius) will be written to the output event table.

Boolean
{DISTANCE | NO_DISTANCE}

Specifies whether a field named DISTANCE will be added to the output event table. The values in this field are in the units of the specified search radius. This parameter is ignored when locating lines or polygons along routes.

  • DISTANCE — A field containing the point to route distance will be added to the output event table. This is the default.
  • NO_DISTANCE — A field containing the point to route distance will not be added to the output event table.

Boolean
{ZERO | NO_ZERO}

When locating polygons along routes, it is possible that events can be created where the from-measure is equal to the to-measure. This parameter is ignored when locating points or lines along routes.

  • ZERO — Zero length line events will be written to the output event table. This is the default.
  • NO_ZERO — Zero length line events will not be written to the output event table.

Boolean
{FIELDS | NO_FIELDS}

Specifies whether the output event table will contain route location fields plus all the attributes from the input features.

  • FIELDS — The output event table will contain route location fields plus all the attributes from the input features. This is the default.
  • NO_FIELDS — The output event table will only contain route location fields plus the ObjectID field from the input features.

Boolean
Data types for geoprocessing tool parameters


Command line example

Workspace "C:\Data"
LocateFeaturesAlongRoutes_lr rail_segments.shp rail_routes.shp rkey "0.5 Feet" locate_lines "rkey LINE fmp tmp"

Workspace "C:\Data\Pitt.mdb"
LocateFeaturesAlongRoutes_lr rail\crossings rail\routes rkey "10 Feet" locate_points "rkey POINT mp"

Workspace "C:\Data\Pitt.gdb"
LocateFeaturesAlongRoutes_lr rail\crossings rail\routes rkey "10 Feet" locate_points "rkey POINT mp"

Workspace "Database Connections\Connection to Jerry.sde"
LocateFeaturesAlongRoutes_lr gdb.counties gdb.rail_routes rkey # locate_polys "rkey LINE fmp tmp" # # NO_ZERO

Scripting syntax
About getting started with writing geoprocessing scripts
LocateFeaturesAlongRoutes_lr (in_features, in_routes, route_id_field, radius_or_tolerance, out_table, out_event_properties, route_locations, distance_field, zero_length_events, in_fields)

Parameter Explanation Data Type
in_features (Required)

The input point, line, or polygon features.

Feature Layer
in_routes (Required)

The routes with which the input features will be intersected.

Feature Layer
route_id_field (Required)

The field containing values that uniquely identify each route. This field can be numeric or character.

Field
radius_or_tolerance (Required)

If the input features are points, the search radius is a numeric value defining how far around each point a search will be done to find a target route.

If the input features are lines, the search tolerance is really a cluster tolerance, which is a numeric value representing the maximum tolerated distance between the input lines and the target routes.

If the input features are polygons, this parameter is ignored since no search radius is used.

Linear unit
out_table (Required)

The table to be created.

Table
out_event_properties (Required)

Parameter consisting of 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 which route each event is along.

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 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 that will contain measure values. Required when the event type is POINT or LINE.

To-Measure Field — A field that will contain measure values. Required when the event type is LINE.

Route Measure Event Properties
route_locations (Optional)

When locating points along routes, it is possible that more than one route may be within the search radius of any given point. This parameter is ignored when locating lines or polygons along routes.

  • FIRST — Only the closest route location will be written to the output event table. This is the default.
  • ALL — Every route location (within the search radius) will be written to the output event table.

Boolean
distance_field (Optional)

Specifies whether a field named DISTANCE will be added to the output event table. The values in this field are in the units of the specified search radius. This parameter is ignored when locating lines or polygons along routes.

  • DISTANCE — A field containing the point to route distance will be added to the output event table. This is the default.
  • NO_DISTANCE — A field containing the point to route distance will not be added to the output event table.

Boolean
zero_length_events (Optional)

When locating polygons along routes, it is possible that events can be created where the from-measure is equal to the to-measure. This parameter is ignored when locating points or lines along routes.

  • ZERO — Zero length line events will be written to the output event table. This is the default.
  • NO_ZERO — Zero length line events will not be written to the output event table.

Boolean
in_fields (Optional)

Specifies whether the output event table will contain route location fields plus all the attributes from the input features.

  • FIELDS — The output event table will contain route location fields plus all the attributes from the input features. This is the default.
  • NO_FIELDS — The output event table will only contain route location fields plus the ObjectID field from the input features.

Boolean

Data types for geoprocessing tool parameters


Script example

# Example 1:
#   Locate shapefile lines along shapefile routes.

import arcgisscripting, constants
gp = arcgisscripting.create()
try:
   gp.Workspace = "C:/Data"
    feats = "rail_segments.shp"
    rts = "rail_routes.shp"
    rid = "rkey"
    tol = "0.5 Feet"
    tbl = "locate_lines"
    props = "rkey LINE fmp tmp" 
    gp.LocateFeaturesAlongRoutes_lr(feats, rts, rid, tol, tbl, props )
except:
    print gp.GetMessages(2)


# Example 2:
# Locate personal geodatabase points along file geodatabase routes.

import arcgisscripting, constants
gp = arcgisscripting.create()
try:
    gp.Workspace = "C:/Data/Pitt.gdb"
    feats = "rail/crossings"          # crossings is in the rail feature dataset 
    rts = "rail/routes"               # routes is in the rail feature dataset
    rid = "rkey"
    rad = "10 Feet"
    tbl = "locate_points"
    props = "rkey POINT mp" 
    gp.LocateFeaturesAlongRoutes_lr(feats, rts, rid, rad, tbl, props )
except:
    print gp.GetMessages(2)


# Example 3:
#   Locate personal geodatabase points along personal geodatabase routes.

import arcgisscripting, constants
gp = arcgisscripting.create()
try:
    gp.Workspace = "C:/Data/Pitt.mdb"
    feats = "rail/crossings"          # crossings is in the rail feature dataset 
    rts = "rail/routes"               # routes is in the rail feature dataset
    rid = "rkey"
    rad = "10 Feet"
    tbl = "locate_points"
    props = "rkey POINT mp" 
    gp.LocateFeaturesAlongRoutes_lr(feats, rts, rid, rad, tbl, props )
except:
    print gp.GetMessages(2)


# Example 4:
#   Locate enterprise geodatabase polygons along enterprise geodatabase routes.

import arcgisscripting, constants
gp = arcgisscripting.create()
try:
    wkspc = "Database Connections/Connection to Jerry.sde"
    gp.Workspace = wkspc 
    feats = gp.QualifyTableName("counties", wkspc)      # standalone feature class
    rts = gp.QualifyTableName("rail_routes", wkspc)     # standalone feature class
    rid = "rkey"
    tbl = "locate_polys"
    props = "rkey LINE fmp tmp" 
    gp.LocateFeaturesAlongRoutes_lr(feats, rts, rid, "#", tbl, props, "#", "#", "NO_ZERO")
except:
    print gp.GetMessages(2)

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.