ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Calibrate Routes

  • Summary
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Recalculates route measures using points.

Usage

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

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

  • If the Output Route Feature Class will be written to a geodatabase, an appropriate M Tolerance, M Resolution, and M Domain environment should be set.

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

  • The outputMFlag environment setting is ignored. The Output Route Feature Class will have M (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 for dynamic segmentation, it is recommended that you choose to have an attribute index created.

  • If any features are rejected by the Calibrate Routes process, a text file is created in the temporary file path to store information about those features. For example, C:\Documents and Settings\patrickb\Local Settings\Temp\Calibrate_Output0.txt (where Calibrate_Output is the name of the Output Route Feature Class).

Syntax

CalibrateRoutes_lr (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})
ParameterExplanationData Type
in_route_features

The route features to be calibrated.

Feature Layer
route_id_field

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

Field
in_point_features

The point features 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 numeric or character.

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 to be created. It can be a shapefile or a geodatabase feature class.

Feature Class
calibrate_method
(Optional)

Specifies how route measures will be recalculated.

  • DISTANCE —Measures will be recalculated using the shortest path distance between the calibration points. This is the default.
  • MEASURES —Measures 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 units of measure are Unknown, the same units as 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.

  • BETWEEN —Interpolate between the calibration points. This is the default.
  • NO_BETWEEN —Do not interpolate between the calibration points.
Boolean
extrapolate_before
(Optional)

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

  • BEFORE —Extrapolate before the calibration points. This is the default.
  • NO_BEFORE —Do not extrapolate before the calibration points.
Boolean
extrapolate_after
(Optional)

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

  • AFTER —Extrapolate after the calibration points. This is the default.
  • NO_AFTER —Do not extrapolate after the calibration points.
Boolean
ignore_gaps
(Optional)

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

  • 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
keep_all_routes
(Optional)

Specifies whether route features that do not have any calibration points will be excluded from the output feature class.

  • KEEP —Keep all route features in the output feature class. This is the default.
  • NO_KEEP —Do not keep all route features in the output feature class. Features that have 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.

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

Code Sample

CalibrateRoutes Example (Python Window)

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

import arcpy
from arcpy import env

env.workspace = "C:/data"
arcpy.CalibrateRoutes_lr("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 Python 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
from arcpy import env

# Set workspace
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

# Execute CalibrateRoutes
arcpy.CalibrateRoutes_lr (rts, rid, pts, rid, mfield, out_fc, "DISTANCE", radius, \
                           "BETWEEN", "NO_BEFORE", "NO_AFTER")
CalibrateRoutes Example #3 (Stand-alone Python Script)

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

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

# Import system modules
import arcpy
from arcpy import env

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

# 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 a feature dataset

# Execute CalibrateRoutes
arcpy.CalibrateRoutes_lr (rts, rid, pts, rid, mfield, out_fc, "DISTANCE", radius, \
                           "BETWEEN", "NO_BEFORE", "NO_AFTER")
CalibrateRoutes Example #4 (Stand-alone Python Script)

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

# Name Example 4:
# Description: Calibrate enterprise geodatabase routes using enterprise geodatabase points.

# Import system modules
import arcpy
from arcpy import env

# Set workspace
wkspc = "Database Connections/Connection to Jerry.sde"
env.workspace = wkspc 

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

# Execute CalibrateRoutes
arcpy.CalibrateRoutes_lr (rts, rid, pts, rid, mfield, out_fc, "DISTANCE", radius, \
                           "#", "#", "#", "#", "NO_KEEP")

Environments

  • Current Workspace
  • M Resolution
  • M Tolerance
  • Output CONFIG Keyword
  • Output M Domain
  • Output XY Domain
  • Output Z Domain
  • Output Coordinate System
  • Extent
  • Output has Z values
  • Scratch Workspace

Licensing Information

  • ArcGIS for Desktop Basic: Yes
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related Topics

  • An overview of the Linear Referencing toolbox
  • About calibrating route measures using points
  • About calibrating routes with points
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal