Cost Path

Running programmatically

Determines the least cost path from a source to destinations based on a cost raster. The result consists of polylines connecting a destination to the nearest source in terms of cost. The input sources and destinations can be Points, Polylines or Polygons. The cost raster defines the cost to move through each cell.

Inputs:

Outputs:

Example:

Cost Path result - polygon sources, point destinations, slope raster is used as Cost raster.

Notes:

Running Programmatically

(Go to TOP)

Parameters

Expression Explanation
Function Name CostPath
<source features> A String - the full path to the input source feature dataset.
<destination features> A String - the full path to the input destination feature dataset.
<cost raster> A String - the full name of the input cost raster.
<output paths> A String - the full path to the output polyline path dataset.
<source ID field> A String representing the name of the field in the input source dataset to be used as source ID.
<destination ID field> A String representing the name of the field in the input destination dataset to be used as destination ID.
<cut-off cost> A Double representing the cut-off cost - (distance x weight). A path exceeding this cost will not be recorded in the output.

Running the function

ETSPath used in the table below is the full path to ETSRun.exe (E.G. "C:\Program Files\ETSpatial Techniques\ETSurface\ETSRun.exe")

CostRaster
Language Syntax
Python subprocess.call([ETSPath, "CostPath", "source features", "destination features", "cost raster", "output paths", "source ID field", "destination ID field", "cut-off cost"])
.NET using ETSRun.exe StartInfo.FileName = ETSPath
StartInfo.Arguments = "CostPath" "source features" "destination features" "cost raster" "output paths" "source ID field" "destination ID field" "cut-off cost"
.NET using ETSOutX.dll CostPath(source features, destination features, cost raster, output paths, source ID field, destination ID field, cut-off cost)
ArcPy arcpy.CostPath("source features", "destination features", "cost raster", "output paths", "source ID field", "destination ID field", "cut-off cost")

Notes:

(Go to TOP)