Available with Spatial Analyst license.
Calculates the least-cost path from a source to a destination.
The Optimal Path As Raster function provides enhanced functionality or performance.
This function produces an output raster that records the least-cost path or paths from selected locations to the closest source cell defined within the accumulative cost surface, in terms of cost distance.
This is a global raster function.
One or more of the weighted cost functions (Distance Accumulation, Cost Distance, Cost Allocation or Cost Back Link) are generally required to be run prior to running the Cost Path function to create the input cost distance and back link rasters. These are mandatory input raster layers to the Cost Path function.
Each least-cost path is assigned a value when encountered in the scanning process. The ending cell on the original source raster layer (from which the cost distance and back link were derived) of a cost path receives one, the first path receives three, the second four, and so on. The value two is reserved for the merged portion of paths that have portions of a common cost path.
The input destination data must be a raster layer. The set of destination cells consists of all cells in the input raster that have valid values. Cells that have NoData values are not included in the set. The value zero is considered a legitimate destination. A destination raster can be created using the extraction tools.
If you have destination or source features, you can convert them to raster using the Rasterize Features function. Use the cost distance or cost back link raster as the Raster input to the rasterization function. This will ensure the feature is rasterized using the same cell size, extent, and spatial reference as the other rasters going into the Cost Path function.
When multiple paths merge and follow the remaining distance back to a source on the same route, the segment where the two paths travel together is assigned the value 2. The merged portion of the path cannot be assigned the value of one of the paths, since the merged portion belongs to both routes.
The Cost Path function can also be used to derive the path of least resistance down a digital elevation model (DEM). In this case, use the DEM for the input cost distance raster and the output from the Flow Direction function for the Cost Backlink Raster.
The Cost Path function parameters are described in the following table:
A raster dataset layer that identifies those cells from which the least-cost path is determined to the least costly source.
The input raster layer consists of cells that have valid values (zero is a valid value), and the remaining cells must be assigned NoData.
The field used to obtain values for the destination locations. Input feature data must contain at least one valid field.
Cost Distance Raster
The name of a cost distance raster to be used to determine the least-cost path from the destination locations to a source.
The cost distance raster is usually created with the Cost Distance, Cost Allocation, or Cost Back Link function. The cost distance raster layer stores, for each cell, the minimum accumulative cost distance over a cost surface from each cell to a set of source cells.
Cost Backlink Raster
The name of a cost backlink raster layer used to determine the path to return to a source via the least-cost path.
For each cell in the backlink raster, a value identifies the neighbor that's the next cell on the least accumulative cost path from the cell to a single source cell or set of source cells.
A keyword defining the manner in which the values and zones on the input destination data will be interpreted in the cost path calculations. The options are as follows:
Force flow direction convention for backlink raster
Forces the function to treat the input backlink raster as a flow direction raster. Flow direction rasters can have integer with values from 0-255.