Calibrate Routes (Linear Referencing)

Summary

Recalculates route measures using points.

Usage

  • Whole or partial routes can be calibrated. You can interpolate between the input points, extrapolate before the input points, extrapolate after the input points, or use any combination of these methods.

  • Use the Make Feature Layer or Make Query Table tool to reduce the routes that will be calibrated.

  • If the Output Route Feature Class parameter value will be written to a geodatabase, set the appropriate M Tolerance, M Resolution, and M Domain environments.

  • The Output Route Feature Class parameter value will include all the fields from the Input Route Features parameter value.

  • The Output has M Values environment setting is ignored. The Output Route Feature Class parameter value will have m-values (measure values).

  • A search radius of infinity cannot be specified.

  • An attribute index on the route identifier field speeds up the dynamic segmentation process. If you will be using the Output Route Feature Class parameter value for dynamic segmentation, it is recommended that you create an attribute index.

  • If any features are rejected by the this tool, a text file is created in the temporary file path to store information about those features, for example, C:\Users\patrickb\AppData\Local\Temp\Calibrate_Output0.txt (in which Calibrate_Output is the name of the Output Route Feature Class parameter value).

Parameters

LabelExplanationData Type
Input Route Features

The route features that will be calibrated.

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 Point Features

The point features that will be used to calibrate the routes.

Feature Layer
Point Identifier Field

The field that identifies the route on which each calibration point is located. The values in this field match those in the route identifier field. This field can be a numeric, text, or GUID field.

Field
Measure Field

The field containing the measure value for each calibration point. This field must be numeric.

Field
Output Route Feature Class

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

Feature Class
Measure Calculation Method
(Optional)

Specifies how route measures will be recalculated.

  • DistanceMeasures will be recalculated using the shortest path distance between the calibration points. This is the default.
  • MeasuresMeasures will be recalculated using the pre-existing measure distance between the calibration points.
String
Search Radius
(Optional)

Limits how far a calibration point can be from a route by specifying the distance and its unit of measure. If the unit of measure is unknown, the units of the coordinate system of the route feature class will be used.

Linear Unit
Interpolate between calibration points
(Optional)

Specifies whether measure values will be interpolated between the calibration points.

  • Checked—Measure values will be interpolated between the calibration points. This is the default.
  • Unchecked—Measure values will not be interpolated between the calibration points.
Boolean
Extrapolate before calibration points
(Optional)

Specifies whether measure values will be extrapolated before the calibration points.

  • Checked—Measure values will be extrapolated before the calibration points. This is the default.
  • Unchecked—Measure values will not be extrapolated before the calibration points.
Boolean
Extrapolate after calibration points
(Optional)

Specifies whether measure values will be extrapolated after the calibration points.

  • Checked—Measure values will be extrapolated after the calibration points. This is the default.
  • Unchecked—Measure values will not be extrapolated after the calibration points.
Boolean
Ignore spatial gaps
(Optional)

Specifies whether spatial gaps will be ignored when recalculating the measures on disjointed routes.

  • Checked—Spatial gaps will be ignored. Measure values will be continuous for disjointed routes. This is the default.
  • Unchecked—Spatial gaps will not be ignored . 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
Include all features in the output feature class
(Optional)

Specifies whether route features with no calibration points will be included in the output feature class.

  • Checked—All route features will be included in the output feature class. This is the default.
  • Unchecked—All route features will not necessarily be included in the output feature class. Features with no calibration points will be excluded.
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 parameter value.

  • Checked—An attribute index will be created. This is the default.
  • Unchecked—An attribute index will not be created.
Boolean

arcpy.lr.CalibrateRoutes(in_route_features, route_id_field, in_point_features, point_id_field, measure_field, out_feature_class, {calibrate_method}, {search_radius}, {interpolate_between}, {extrapolate_before}, {extrapolate_after}, {ignore_gaps}, {keep_all_routes}, {build_index})
NameExplanationData Type
in_route_features

The route features that will be calibrated.

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_point_features

The point features that will be used to calibrate the routes.

Feature Layer
point_id_field

The field that identifies the route on which each calibration point is located. The values in this field match those in the route identifier field. This field can be a numeric, text, or GUID field.

Field
measure_field

The field containing the measure value for each calibration point. This field must be numeric.

Field
out_feature_class

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

Feature Class
calibrate_method
(Optional)

Specifies how route measures will be recalculated.

  • DISTANCEMeasures will be recalculated using the shortest path distance between the calibration points. This is the default.
  • MEASURESMeasures will be recalculated using the pre-existing measure distance between the calibration points.
String
search_radius
(Optional)

Limits how far a calibration point can be from a route by specifying the distance and its unit of measure. If the unit of measure is unknown, the units of the coordinate system of the route feature class will be used.

Linear Unit
interpolate_between
(Optional)

Specifies whether measure values will be interpolated between the calibration points.

  • BETWEENMeasure values will be interpolated between the calibration points. This is the default.
  • NO_BETWEENMeasure values will not be interpolated between the calibration points.
Boolean
extrapolate_before
(Optional)

Specifies whether measure values will be extrapolated before the calibration points.

  • BEFOREMeasure values will be extrapolated before the calibration points. This is the default.
  • NO_BEFOREMeasure values will not be extrapolated before the calibration points.
Boolean
extrapolate_after
(Optional)

Specifies whether measure values will be extrapolated after the calibration points.

  • AFTERMeasure values will be extrapolated after the calibration points. This is the default.
  • NO_AFTERMeasure values will not be extrapolated after the calibration points.
Boolean
ignore_gaps
(Optional)

Specifies whether spatial gaps will be ignored when recalculating the measures on disjointed routes.

  • IGNORESpatial gaps will be ignored. Measure values will be continuous for disjointed routes. This is the default.
  • NO_IGNORESpatial gaps will not be ignored. 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
keep_all_routes
(Optional)

Specifies whether route features that do not have calibration points will be included in the output feature class.

  • KEEPAll route features will be included in the output feature class. This is the default.
  • NO_KEEPAll route features will not necessarily be included in the output feature class. Features with no calibration points will be excluded.
Boolean
build_index
(Optional)

Specifies whether an attribute index will be created for the route identifier field that is written to the out_feature_class parameter value.

  • INDEXAn attribute index will be created. This is the default.
  • NO_INDEXAn attribute index will not be created.
Boolean

Code sample

CalibrateRoutes example 1 (Python window)

The following Python window script demonstrates how to use the CalibrateRoutes function in immediate mode.

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.lr.CalibrateRoutes("hwy.shp", "RID", "cal_pts.shp", "RID", "MEASURE", 
                         "C:/output/hwy_new.shp","DISTANCE", "5.0 feet", 
                         "BETWEEN", "BEFORE", "AFTER", "#", "NO_KEEP")
CalibrateRoutes example 2 (stand-alone script)

The following Python script demonstrates how to use the CalibrateRoutes function with file geodatabase data in a stand-alone Python script.

# Name CalibrateRoutes_Example2.py
# Description: Calibrate personal geodatabase routes with file geodatabase 
# points.

# Import system modules
import arcpy

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

# Set local variables
rts = "roads/hwy"  # hwy is in the roads feature dataset
rid = "ROUTE1" 
pts = "roads/cal_pts"  # cal_pts is in the roads feature dataset
mfield = "MEASURE"
radius = "2.5 Meters"
out_fc = "roads/hwy_new"  # new feature class in the roads feature dataset

# Run CalibrateRoutes
arcpy.lr.CalibrateRoutes(rts, rid, pts, rid, mfield, out_fc, "DISTANCE", radius, 
                         "BETWEEN", "NO_BEFORE", "NO_AFTER")
CalibrateRoutes example 3 (stand-alone script)

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

# Name CalibrateRoutes_Example3.py
# Description: Calibrate enterprise geodatabase routes using enterprise 
# geodatabase points.

# Import system modules
import arcpy

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

# Set local variables
rts = arcpy.ValidateTableName("hwy", wkspc)  # standalone feature class
rid = "ROUTE1"
pts = arcpy.ValidateTableName("cal_pts", wkspc)  # standalone feature class
mfield = "MEASURE"
radius = "5.0 Feet"
out_fc = "hwy_new" # new standalone feature class 

# Run CalibrateRoutes
arcpy.lr.CalibrateRoutes(rts, rid, pts, rid, mfield, out_fc, "DISTANCE", radius, 
                         "#", "#", "#", "#", "NO_KEEP")

Licensing information

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

Related topics