com.esri.arcgis.geoprocessing.tools.spatialanalysttools
Class CostAllocation
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.spatialanalysttools.CostAllocation
- All Implemented Interfaces:
- GPTool
public class CostAllocation
- extends AbstractGPTool
Calculates for each cell its nearest source based on the least accumulative cost over a cost surface.
The Cost Allocation tool is contained in the Spatial Analyst Tools tool box.
Usage tips:
- The input source data can be a feature class or raster.
- When the input source data is a raster, the set of source cells consists of all cells in the source raster that have valid values. Cells that have NoData values are not included in the source set. The value 0 is considered a legitimate source. A source raster can be easily created using the .
- Source locations require an associated value, which can be specified by the a field. If the input source raster is floating point raster an integer value raster parameter must be specified.
- Cell locations with NoData in the Input cost raster act as barriers in the cost surface tools. Any cell location that is assigned NoData on the input cost surface will receive NoData on all output rasters (cost distance, allocation, and back link).
- If the input source data and the cost raster are different extents, the default output extent is the intersection of the two. To get a cost distance surface for the entire extent, choose the Union of Inputs option on the output environment settings.
- If a has been set in the environment, all masked cells will be treated as NoData values.When a mask has been defined in the Raster Analysis window and the cells to be masked will mask a source, the calculations will occur on the remaining source cells. The source cells that are masked will not be considered in the computations. These cell locations will be assigned NoData on all outputs (distance, allocation, and back link) rasters.
- The Input value raster is useful when alternative values or zones are to be used or if source was derived from a operatotion that results in a binary result of either 0 or 1, losing the original zone values that are associated with these locations. The value raster can restore these values or allow for analysis on additional combinations of zone values within the source locations.If the value raster is used, it may change the configuration and results of the cost allocation output; it will not affect the optional cost distance or the back link results.
- The Maximum distance is specified in the same cost units as those on the cost raster.
- For the output distance raster, the least-cost distance (or minimum accumulative cost distance) of a cell to a set of source locations is the lower bound of the least-cost distances from the cell to all source locations.
Constructor Summary |
CostAllocation()
Creates the Cost Allocation tool with defaults. |
CostAllocation(java.lang.Object inSourceData,
java.lang.Object inCostRaster,
java.lang.Object outAllocationRaster)
Creates the Cost Allocation tool with the required parameters. |
Method Summary |
java.lang.Object |
getInCostRaster()
Returns the Input cost raster parameter of this tool . |
java.lang.Object |
getInSourceData()
Returns the Input raster or feature source data parameter of this tool . |
java.lang.Object |
getInValueRaster()
Returns the Input value raster parameter of this tool . |
double |
getMaximumDistance()
Returns the Maximum distance parameter of this tool . |
java.lang.Object |
getOutAllocationRaster()
Returns the Output allocation raster parameter of this tool . |
java.lang.Object |
getOutBacklinkRaster()
Returns the Output backlink raster parameter of this tool . |
java.lang.Object |
getOutDistanceRaster()
Returns the Output distance raster parameter of this tool . |
java.lang.Object |
getSourceField()
Returns the Source field parameter of this tool . |
java.lang.String |
getToolboxAlias()
Returns the alias of the tool box containing this tool. |
java.lang.String |
getToolboxName()
Returns the name of the tool box containing this tool. |
java.lang.String |
getToolName()
Returns the name of this tool. |
void |
setInCostRaster(java.lang.Object inCostRaster)
Sets the Input cost raster parameter of this tool . |
void |
setInSourceData(java.lang.Object inSourceData)
Sets the Input raster or feature source data parameter of this tool . |
void |
setInValueRaster(java.lang.Object inValueRaster)
Sets the Input value raster parameter of this tool . |
void |
setMaximumDistance(double maximumDistance)
Sets the Maximum distance parameter of this tool . |
void |
setOutAllocationRaster(java.lang.Object outAllocationRaster)
Sets the Output allocation raster parameter of this tool . |
void |
setOutBacklinkRaster(java.lang.Object outBacklinkRaster)
Sets the Output backlink raster parameter of this tool . |
void |
setOutDistanceRaster(java.lang.Object outDistanceRaster)
Sets the Output distance raster parameter of this tool . |
void |
setSourceField(java.lang.Object sourceField)
Sets the Source field parameter of this tool . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CostAllocation
public CostAllocation()
- Creates the Cost Allocation tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
CostAllocation
public CostAllocation(java.lang.Object inSourceData,
java.lang.Object inCostRaster,
java.lang.Object outAllocationRaster)
- Creates the Cost Allocation tool with the required parameters.
Initializes the array of tool parameters with the values as specified for the required parameters and with the default values for the other parameters.
- Parameters:
inSourceData
- the input source locations. this is a raster or feature dataset that identifies the cells or locations to which the least accumulated cost distance for every output cell location is calculated. for rasters, the input type can be integer or floating point. if the input source raster is floating point, the {in_value_raster} must be set, and it must be of integer type. The value raster will take precedence over any setting of the {source_field}.inCostRaster
- a raster 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 of the cost raster can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost).outAllocationRaster
- the output cost allocation raster. this raster identifies the zone of each source location (cell or feature) that could be reached with the least accumulative cost. the output raster is of integer type
getInSourceData
public java.lang.Object getInSourceData()
- Returns the Input raster or feature source data parameter of this tool .
This parameter is the input source locations. this is a raster or feature dataset that identifies the cells or locations to which the least accumulated cost distance for every output cell location is calculated. for rasters, the input type can be integer or floating point. if the input source raster is floating point, the {in_value_raster} must be set, and it must be of integer type. The value raster will take precedence over any setting of the {source_field}.
This is a required parameter.
- Returns:
- the Input raster or feature source data
setInSourceData
public void setInSourceData(java.lang.Object inSourceData)
- Sets the Input raster or feature source data parameter of this tool .
This parameter is the input source locations. this is a raster or feature dataset that identifies the cells or locations to which the least accumulated cost distance for every output cell location is calculated. for rasters, the input type can be integer or floating point. if the input source raster is floating point, the {in_value_raster} must be set, and it must be of integer type. The value raster will take precedence over any setting of the {source_field}.
This is a required parameter.
- Parameters:
inSourceData
- the input source locations. this is a raster or feature dataset that identifies the cells or locations to which the least accumulated cost distance for every output cell location is calculated. for rasters, the input type can be integer or floating point. if the input source raster is floating point, the {in_value_raster} must be set, and it must be of integer type. The value raster will take precedence over any setting of the {source_field}.
getInCostRaster
public java.lang.Object getInCostRaster()
- Returns the Input cost raster parameter of this tool .
This parameter is a raster 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 of the cost raster can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost).
This is a required parameter.
- Returns:
- the Input cost raster
setInCostRaster
public void setInCostRaster(java.lang.Object inCostRaster)
- Sets the Input cost raster parameter of this tool .
This parameter is a raster 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 of the cost raster can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost).
This is a required parameter.
- Parameters:
inCostRaster
- a raster 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 of the cost raster can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost).
getOutAllocationRaster
public java.lang.Object getOutAllocationRaster()
- Returns the Output allocation raster parameter of this tool .
This parameter is the output cost allocation raster. this raster identifies the zone of each source location (cell or feature) that could be reached with the least accumulative cost. the output raster is of integer type
This is a required parameter.
- Returns:
- the Output allocation raster
setOutAllocationRaster
public void setOutAllocationRaster(java.lang.Object outAllocationRaster)
- Sets the Output allocation raster parameter of this tool .
This parameter is the output cost allocation raster. this raster identifies the zone of each source location (cell or feature) that could be reached with the least accumulative cost. the output raster is of integer type
This is a required parameter.
- Parameters:
outAllocationRaster
- the output cost allocation raster. this raster identifies the zone of each source location (cell or feature) that could be reached with the least accumulative cost. the output raster is of integer type
getMaximumDistance
public double getMaximumDistance()
- Returns the Maximum distance parameter of this tool .
This parameter is defines the threshold that the accumulative cost values cannot exceed. if an accumulative cost distance value exceeds this value, the output value for the cell location will be NoData. The maximum distance defines the extent for which the accumulative cost distances are calculated. the default distance is to the edge of the output raster.
This is an optional parameter.
- Returns:
- the Maximum distance
setMaximumDistance
public void setMaximumDistance(double maximumDistance)
- Sets the Maximum distance parameter of this tool .
This parameter is defines the threshold that the accumulative cost values cannot exceed. if an accumulative cost distance value exceeds this value, the output value for the cell location will be NoData. The maximum distance defines the extent for which the accumulative cost distances are calculated. the default distance is to the edge of the output raster.
This is an optional parameter.
- Parameters:
maximumDistance
- defines the threshold that the accumulative cost values cannot exceed. if an accumulative cost distance value exceeds this value, the output value for the cell location will be NoData. The maximum distance defines the extent for which the accumulative cost distances are calculated. the default distance is to the edge of the output raster.
getInValueRaster
public java.lang.Object getInValueRaster()
- Returns the Input value raster parameter of this tool .
This parameter is the input integer raster that identifies the zone values that should be used for each input source location. for each source location (cell or feature), the value defined by the {in_value_raster} will be assigned to all cells allocated to the source location for the computation. The value raster will take precedence over any setting for the {source_field}.
This is an optional parameter.
- Returns:
- the Input value raster
setInValueRaster
public void setInValueRaster(java.lang.Object inValueRaster)
- Sets the Input value raster parameter of this tool .
This parameter is the input integer raster that identifies the zone values that should be used for each input source location. for each source location (cell or feature), the value defined by the {in_value_raster} will be assigned to all cells allocated to the source location for the computation. The value raster will take precedence over any setting for the {source_field}.
This is an optional parameter.
- Parameters:
inValueRaster
- the input integer raster that identifies the zone values that should be used for each input source location. for each source location (cell or feature), the value defined by the {in_value_raster} will be assigned to all cells allocated to the source location for the computation. The value raster will take precedence over any setting for the {source_field}.
getSourceField
public java.lang.Object getSourceField()
- Returns the Source field parameter of this tool .
This parameter is the field used to assign values to the source locations. It must be integer type. if the {in_value_raster} has been set, the values in that input will have precedence over any setting for the {source_field}.
This is an optional parameter.
- Returns:
- the Source field
setSourceField
public void setSourceField(java.lang.Object sourceField)
- Sets the Source field parameter of this tool .
This parameter is the field used to assign values to the source locations. It must be integer type. if the {in_value_raster} has been set, the values in that input will have precedence over any setting for the {source_field}.
This is an optional parameter.
- Parameters:
sourceField
- the field used to assign values to the source locations. It must be integer type. if the {in_value_raster} has been set, the values in that input will have precedence over any setting for the {source_field}.
getOutDistanceRaster
public java.lang.Object getOutDistanceRaster()
- Returns the Output distance raster parameter of this tool .
This parameter is the output cost distance raster. the cost distance raster identifies, for each cell, the least accumulative cost distance over a cost surface to the identified source locations. a source can be a cell, a set of cells, or one or more feature locations. the output raster is of floating point type.
This is an optional parameter.
- Returns:
- the Output distance raster
setOutDistanceRaster
public void setOutDistanceRaster(java.lang.Object outDistanceRaster)
- Sets the Output distance raster parameter of this tool .
This parameter is the output cost distance raster. the cost distance raster identifies, for each cell, the least accumulative cost distance over a cost surface to the identified source locations. a source can be a cell, a set of cells, or one or more feature locations. the output raster is of floating point type.
This is an optional parameter.
- Parameters:
outDistanceRaster
- the output cost distance raster. the cost distance raster identifies, for each cell, the least accumulative cost distance over a cost surface to the identified source locations. a source can be a cell, a set of cells, or one or more feature locations. the output raster is of floating point type.
getOutBacklinkRaster
public java.lang.Object getOutBacklinkRaster()
- Returns the Output backlink raster parameter of this tool .
This parameter is the output cost back-link raster. the back-link raster contains values of 0 through 8, which define the direction or identify the next neighboring cell (the succeeding cell) along the least accumulative cost path from a cell to reach its least cost source. if the path is to pass into the right neighbor, the cell will be assigned the value 1, 2 for the lower right diagonal cell, and continuing clockwise. The value 0 is reserved for source cells.
This is an optional parameter.
- Returns:
- the Output backlink raster
setOutBacklinkRaster
public void setOutBacklinkRaster(java.lang.Object outBacklinkRaster)
- Sets the Output backlink raster parameter of this tool .
This parameter is the output cost back-link raster. the back-link raster contains values of 0 through 8, which define the direction or identify the next neighboring cell (the succeeding cell) along the least accumulative cost path from a cell to reach its least cost source. if the path is to pass into the right neighbor, the cell will be assigned the value 1, 2 for the lower right diagonal cell, and continuing clockwise. The value 0 is reserved for source cells.
This is an optional parameter.
- Parameters:
outBacklinkRaster
- the output cost back-link raster. the back-link raster contains values of 0 through 8, which define the direction or identify the next neighboring cell (the succeeding cell) along the least accumulative cost path from a cell to reach its least cost source. if the path is to pass into the right neighbor, the cell will be assigned the value 1, 2 for the lower right diagonal cell, and continuing clockwise. The value 0 is reserved for source cells.
getToolName
public java.lang.String getToolName()
- Returns the name of this tool.
- Returns:
- the tool name
getToolboxName
public java.lang.String getToolboxName()
- Returns the name of the tool box containing this tool.
- Returns:
- the tool box name
getToolboxAlias
public java.lang.String getToolboxAlias()
- Returns the alias of the tool box containing this tool.
- Returns:
- the tool box alias