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

Create 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

Creates routes from existing lines. The input line features that share a common identifier are merged to create a single route.


Usage tips

Command line syntax
An overview of the Command Line window
CreateRoutes_lr <in_line_features> <route_id_field> <out_feature_class> <LENGTH | ONE_FIELD | TWO_FIELDS> {from_measure_field} {to_measure_field} {UPPER_LEFT | LOWER_LEFT | UPPER_RIGHT | LOWER_RIGHT} {measure_factor} {measure_offset} {IGNORE | NO_IGNORE} {INDEX | NO_INDEX}

Parameter Explanation Data Type
<in_line_features>

The features from which routes will be created.

Feature Layer
<route_id_field>

The field containing values that uniquely identify each route.

Field
<out_feature_class>

The feature class to be created. It can be a shapefile or a geodatabase feature class.

Feature Class
<LENGTH | ONE_FIELD | TWO_FIELDS>

Specifies how route measures will be obtained.

  • LENGTH — The geometric length of the input features will be used to accumulate the measures. This is the default.
  • ONE_FIELD — The value stored in a single field will be used to accumulate the measures.
  • TWO_FIELDS — The values stored in both from- and to-measure fields will be used to set the measures.

String
{from_measure_field}

A field containing measure values. This field must be numeric and is required when the measure source is ONE_FIELD or TWO_FIELDS.

Field
{to_measure_field}

A field containing measure values. This field must be numeric and is required when the measure source is TWO_FIELDS.

Field
{UPPER_LEFT | LOWER_LEFT | UPPER_RIGHT | LOWER_RIGHT}

The position from which measures will be accumulated for each output route. This parameter is ignored when the measure source is TWO_FIELDS.

  • UPPER_LEFT — Measures will be accumulated from the point closest to the minimum bounding rectangle's upper left corner. This is the default.
  • LOWER_LEFT — Measures will be accumulated from the point closest to the minimum bounding rectangle's lower left corner.
  • UPPER_RIGHT — Measures will be accumulated from the point closest to the minimum bounding rectangle's upper right corner.
  • LOWER_RIGHT — Measures will be accumulated from the point closest to the minimum bounding rectangle's lower right corner.

String
{measure_factor}

A value multiplied by the measure length of each input line before they are merged to create route measures. The default is 1.

Double
{measure_offset}

A value added to the route measures after the input lines have been merged to create a route. The default is 0.

Double
{IGNORE | NO_IGNORE}

Specifies whether spatial gaps will be ignored when calculating the measures on disjointed routes. This parameter is applicable when the measure source is LENGTH or ONE_FIELD.

  • IGNORE — Spatial gaps will be ignored. Measure values will be continuous for disjointed routes. This is the default.
  • NO_IGNORE — Do not ignore spatial gaps. The measure values on disjointed routes will have gaps. The gap distance is calculated using the straight-line distance between the endpoints of the disjointed parts.

Boolean
{INDEX | NO_INDEX}

Specifies whether an attribute index will be created for the route identifier field that is written to the output route feature class.

  • INDEX — Create an attribute index. This is the default.
  • NO_INDEX — Do not create an attribute index.

Boolean
Data types for geoprocessing tool parameters


Command line example

Workspace "C:\Data"
CreateRoutes_lr base_roads.shp route1 create_output1 LENGTH # # LOWER_LEFT 0.00018939394

Workspace "C:\Data\pitt.mdb"
CreateRoutes_lr roads\base_roads route1 roads\create_output2 ONE_FIELD len_mile # LOWER_LEFT

Workspace "C:\Data\pitt.gdb"
CreateRoutes_lr roads\base_roads route1 roads\create_output2 LENGTH # # LOWER_LEFT

Workspace "Database Connections\Connection to Jerry.sde"
CreateRoutes

Scripting syntax
About getting started with writing geoprocessing scripts
CreateRoutes_lr (in_line_features, route_id_field, out_feature_class, measure_source, from_measure_field, to_measure_field, coordinate_priority, measure_factor, measure_offset, ignore_gaps, build_index)

Parameter Explanation Data Type
in_line_features (Required)

The features from which routes will be created.

Feature Layer
route_id_field (Required)

The field containing values that uniquely identify each route.

Field
out_feature_class (Required)

The feature class to be created. It can be a shapefile or a geodatabase feature class.

Feature Class
measure_source (Required)

Specifies how route measures will be obtained.

  • LENGTH — The geometric length of the input features will be used to accumulate the measures. This is the default.
  • ONE_FIELD — The value stored in a single field will be used to accumulate the measures.
  • TWO_FIELDS — The values stored in both from- and to-measure fields will be used to set the measures.

String
from_measure_field (Optional)

A field containing measure values. This field must be numeric and is required when the measure source is ONE_FIELD or TWO_FIELDS.

Field
to_measure_field (Optional)

A field containing measure values. This field must be numeric and is required when the measure source is TWO_FIELDS.

Field
coordinate_priority (Optional)

The position from which measures will be accumulated for each output route. This parameter is ignored when the measure source is TWO_FIELDS.

  • UPPER_LEFT — Measures will be accumulated from the point closest to the minimum bounding rectangle's upper left corner. This is the default.
  • LOWER_LEFT — Measures will be accumulated from the point closest to the minimum bounding rectangle's lower left corner.
  • UPPER_RIGHT — Measures will be accumulated from the point closest to the minimum bounding rectangle's upper right corner.
  • LOWER_RIGHT — Measures will be accumulated from the point closest to the minimum bounding rectangle's lower right corner.

String
measure_factor (Optional)

A value multiplied by the measure length of each input line before they are merged to create route measures. The default is 1.

Double
measure_offset (Optional)

A value added to the route measures after the input lines have been merged to create a route. The default is 0.

Double
ignore_gaps (Optional)

Specifies whether spatial gaps will be ignored when calculating the measures on disjointed routes. This parameter is applicable when the measure source is LENGTH or ONE_FIELD.

  • IGNORE — Spatial gaps will be ignored. Measure values will be continuous for disjointed routes. This is the default.
  • NO_IGNORE — Do not ignore spatial gaps. The measure values on disjointed routes will have gaps. The gap distance is calculated using the straight-line distance between the endpoints of the disjointed parts.

Boolean
build_index (Optional)

Specifies whether an attribute index will be created for the route identifier field that is written to the output route feature class.

  • INDEX — Create an attribute index. This is the default.
  • NO_INDEX — Do not create an attribute index.

Boolean

Data types for geoprocessing tool parameters


Script example

# Example 1:
#   Create routes from lines. The lines are in a shapefile workspace.
#   The LENGTH option will be used to set the measures, and a measure factor
#   will be used to convert measure units from feet to miles.

import arcgisscripting, constants
gp = arcgisscripting.create()
try:
    gp.Workspace = "C:/Data"
    in_lines = "base_roads.shp"
    rid = "route1" 
    out_routes = "create_output1" 
    gp.CreateRoutes_lr(in_lines, rid, out_routes, "LENGTH", "#", "#", "LOWER_LEFT", 0.00018939394)
except:
    print gp.GetMessages(2)


# Example 2:
#   Create routes from lines. The lines are in a file geodatabase.
#   The ONE_FIELD option will be used to set the measures.

import arcgisscripting, constants
gp = arcgisscripting.create()
try:
    gp.Workspace = "C:/Data/pitt.gdb"
    in_lines = "roads/base_roads"                  # base_roads exists in the roads feature dataset
    rid = "route1"
    m_fld = "len_mile"
    out_routes = "roads/create_output2"            # write the result to the roads feature dataset
    gp.CreateRoutes_lr(in_lines, rid, out_routes, "ONE_FIELD", m_fld, "#", "LOWER_LEFT")
except:
    print gp.GetMessages(2)


# Example 3:
#   Create routes from lines. The lines are in a personal geodatabase.
#   The ONE_FIELD option will be used to set the measures.

import arcgisscripting, constants
gp = arcgisscripting.create()
try:
    gp.Workspace = "C:/Data/pitt.mdb"
    in_lines = "roads/base_roads"                  # base_roads exists in the roads feature dataset 
    rid = "route1"
    m_fld = "len_mile" 
    out_routes = "roads/create_output2"            # write the result to the roads feature dataset 
    gp.CreateRoutes_lr(in_lines, rid, out_routes, "ONE_FIELD", m_fld, "#", "LOWER_LEFT")
except:
    print gp.GetMessages(2)


# Example 4:
#   Create routes from lines. The lines are in an enterprise geodatabase.
#   The TWO_FIELD option will be used to set the measures.

import arcgisscripting, constants
gp = arcgisscripting.create()
try:
    wkspc = "Database Connections/Connection to Jerry.sde"
    gp.Workspace = wkspc 
    in_lines = gp.QualifyTableName("base_roads", wkspc)   # base_roads is a standalone feature class
    rid = "route1"
    fr_fld = "begmp1"
    to_fld = "endmp1" 
    out_routes = "create_output3"                   # write the result to a standalone feature class
    gp.CreateRoutes_lr(in_lines, rid, out_routes, "TWO_FIELDS", fr_fld, to_fld) 
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.