This document is archived and information here might be outdated. Recommended version. |
Calculates for each cell the least-accumulative-cost distance over a cost surface to a source cell or a set of source cells.
[Visual Basic .NET] Public Function CostDistance ( _ ByVal sourceData As IGeoDataset, _ ByVal costRaster As IGeoDataset, _ [ByRef maxDistance As Object], _ [ByRef valueRaster As Object] _ ) As IGeoDataset
[C#] public IGeoDataset CostDistance ( IGeoDataset sourceData, IGeoDataset costRaster, ref object maxDistance, ref object valueRaster );
[C++]
HRESULT CostDistance(
IGeoDataset* sourceData,
IGeoDataset* costRaster,
Variant* maxDistance,
Variant* valueRaster
);
[C++]
Parameters sourceData [in]
sourceData is a parameter of type IGeoDataset* costRaster [in]
costRaster is a parameter of type IGeoDataset* maxDistance [in, optional]
maxDistance is a parameter of type VARIANT* valueRaster [in, optional]
valueRaster is a parameter of type VARIANT*
sourceData |
an input Raster, RasterDataset, RasterBand, or RasterDescriptor or Feature that identifies those cells or locations to which the least accumulated cost distances for every cell is calculated For Rasters, the input value types can be either integer, string or floating-point type if in_raster_value is used. |
costRaster |
an input Raster, RasterDataset, RasterBand, or RasterDescriptor defining the impedance or cost to move planimetrically through each cell The value at each cell location represents the cost per unit distance for moving through the cell. Each cell location value is multiplied by the cell resolution (while also compensating for diagonal movement) to obtain the total cost of passing through the cell. The values on the costRaster can be integer or floating point, but they cannot be negative (you cannot have a negative cost). |
[maxDistance] |
defines the threshold that the accumulative cost values cannot exceed If an accumulative cost distance value exceeds the maxDistance, the output value for the cell location will be NoData. The maxDistance defines the extent which the accumulative cost distances are calculated. If no maxDistance is specified the distance will be to the edge of the output raster. The data type for maxDistance can be either integer or floating point. |
[valueRaster] |
an optional input Raster that identifies the zone values that should be used for each cell on the sourceData The value defined by the valueRaster for each source cell will be assigned to all cells that will be allocated to the source cell in the cost allocation computations. If no valueRaster is specified, the zone value for a source cell is the value on the sourceData. This parameter is particularly important if the sourceRaster was created by the ILogicalOp::Test or a ILogicalOp::Boolean methods that will only output 1 and 0 or if alternative values or zones are to be used instead of the existing ones, on the input source. The data type for the valueRaster can be any Raster object that supports IGeoDataset (e.g., Raster, Raster band, etc.). |