Calculate Measures

Calculates the measure length of each feature in a feature class. This is computed by summing the differences between the measures of each consecutive pair of vertices in each feature.

Usage Tips

The Input Feature Class can be a geodatabase, shapefile, or coverage.

The Output Feature Class can be a geodatabase or shapefile, but not a coverage.

If the Input Feature Class is a geodatabase, then an Output Feature Class must be specified OR the MEASURELEN field must already exist in the Input Feature Class, otherwise the tool will abort (because it is unable to acquire a schema lock.)

If the Input Feature Class is a shapefile, then an Output Feature Class must be specified OR the MEASURELEN field must already exist in the Input Feature Class OR the Input Feature Class must currently not be a layer in ArcMap, otherwise the tool will abort (because it is unable to acquire a schema lock.)

If schema lock problems persist, you can try exiting ArcMap/ArcCatalog, check for the schema lock file (<geodatabase>.ldb in the case of geodatabases), delete if it still exists and no one else is using the database, restart ArcMap/ArcCatalog, and try running the tool again.

Command line syntax

CalculateMeasures <Input_Feature_Class> {Output_Feature_Class}

Parameters

Expression Explanation
<Input_Feature_Class>

The input feature class.

The Input Feature Class can be a geodatabase, shapefile, or coverage.

If the Input Feature Class is a geodatabase, then an Output Feature Class must be specified OR the MEASURELEN field must already exist in the Input Feature Class, otherwise the tool will abort (because it is unable to acquire a schema lock.)

If the Input Feature Class is a shapefile, then an Output Feature Class must be specified OR the MEASURELEN field must already exist in the Input Feature Class OR the Input Feature Class must currently not be a layer in ArcMap, otherwise the tool will abort (because it is unable to acquire a schema lock.)

{Output_Feature_Class}

The output feature class.

The measure length of each feature is calculated and written to a field named MEASURELEN in the Output Feature Class.

If no Output Feature Class is specified, then the Input Feature Class is used for output.

If an Output Feature Class is specified it must not already exist.

The Output Feature Class can be a geodatabase or shapefile, but not a coverage.

If the Input Feature Class is a geodatabase, then an Output Feature Class must be specified OR the MEASURELEN field must already exist in the Input Feature Class, otherwise the tool will abort (because it is unable to acquire a schema lock.)

If the Input Feature Class is a shapefile, then an Output Feature Class must be specified OR the MEASURELEN field must already exist in the Input Feature Class OR the Input Feature Class must currently not be a layer in ArcMap, otherwise the tool will abort (because it is unable to acquire a schema lock.)

Command Line Example

CalculateMeasures roads.shp
Executing (CalculateMeasures_2): CalculateMeasures "C:\Documents and Settings\dchatfie\My Documents\linear_referencing\roads.shp" #
Start Time: Tue Apr 18 16:39:50 2006
Running script CalculateMeasures...
Completed script CalculateMeasures...
Executed (CalculateMeasures_2) successfully.
End Time: Tue Apr 18 16:39:56 2006 (Elapsed Time: 6.00 secs)

Scripting syntax

CalculateMeasures (Input_Feature_Class, Output_Feature_Class)

Parameters

Expression Explanation
Input Feature Class (Required)

The input feature class.

The Input Feature Class can be a geodatabase, shapefile, or coverage.

If the Input Feature Class is a geodatabase, then an Output Feature Class must be specified OR the MEASURELEN field must already exist in the Input Feature Class, otherwise the tool will abort (because it is unable to acquire a schema lock.)

If the Input Feature Class is a shapefile, then an Output Feature Class must be specified OR the MEASURELEN field must already exist in the Input Feature Class OR the Input Feature Class must currently not be a layer in ArcMap, otherwise the tool will abort (because it is unable to acquire a schema lock.)

Output Feature Class (Optional)

The output feature class.

The measure length of each feature is calculated and written to a field named MEASURELEN in the Output Feature Class.

If no Output Feature Class is specified, then the Input Feature Class is used for output.

If an Output Feature Class is specified it must not already exist.

The Output Feature Class can be a geodatabase or shapefile, but not a coverage.

If the Input Feature Class is a geodatabase, then an Output Feature Class must be specified OR the MEASURELEN field must already exist in the Input Feature Class, otherwise the tool will abort (because it is unable to acquire a schema lock.)

If the Input Feature Class is a shapefile, then an Output Feature Class must be specified OR the MEASURELEN field must already exist in the Input Feature Class OR the Input Feature Class must currently not be a layer in ArcMap, otherwise the tool will abort (because it is unable to acquire a schema lock.)

Script Example

# Import modules.
import sys, string, os, win32com.client

# Create the Geoprocessor object
gp = win32com.client.Dispatch('esriGeoprocessing.GpDispatch.1')

# Load required toolboxes...
gp.AddToolbox('C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx')

# Load DV Linear Referencing toolbox.
gp.AddToolbox('C:/Documents and Settings/dchatfie/Application Data/ESRI/ArcToolbox/My Toolboxes/' + \
                         'DV Linear Referencing Tools.tbx')

# Set workspace.
gp.workspace = 'c:/documents and settings/dchatfie/my documents/linear_referencing'

# Run calculate measures script.
gp.calculatemeasures('roads.shp')