com.esri.arcgis.geoprocessing.tools.spatialanalysttools
Class BlockStatistics
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.spatialanalysttools.BlockStatistics
- All Implemented Interfaces:
- GPTool
- public class BlockStatistics
- extends AbstractGPTool
Calculates statistics for a nonoverlapping neighborhood.
The Block Statistics tool is contained in the Spatial Analyst Tools tool box.
Learn more about how Block Statistics works
Software restrictions: none
Usage tips:
- When a circular, annulus-shaped, or wedge-shaped neighborhood is specified, depending on the size of the neighborhood, cells that are not perpendicular to the x- or y-axis may not be considered in the calculations. However, these cell locations will receive the resulting value from the calculations of the neighborhood because they fall within the minimum-bounding rectangle (or the output block) of the three circular neighborhoods.
- If the input raster is of floating point type, only the Mean, Maximum, Minimum, Range, STD and Sum statistics are available. If the input raster is of integer type, all the statistics types are available.
- If the input raster is integer, the output raster will be integer. An exception is for the Mean or STD statistics types, for which the output raster will always be floating point. If the input type is float, the output will be float for all of the available statistics types.
- For statistics type Median, if the number of cells in the block is odd, the values are ranked and the middle value is reported as the median and is an integer. If the number of cells in the block is even, the values are ranked and the middle two values are averaged to the nearest integer.
- For statistics type Majority, cells where there is no single majority valuethat is, two or more values within a block are tied as having the most number of cells with the valuewill be assigned NoData. For statistics type Minority, cells where there is no single minority value will also be assigned NoData.
- The Irregular and Weight neighborhood types require a Kernel file.
- When the Statistic type is Mean, Minority, Standard Deviation or Sum, the Neighborhood type can be set to Weight. The Weight neighbourhood requires a Kernel file.
|
Constructor Summary |
BlockStatistics()
Creates the Block Statistics tool with defaults. |
BlockStatistics(java.lang.Object inRaster,
java.lang.Object outRaster)
Creates the Block Statistics tool with the required parameters. |
|
Method Summary |
java.lang.String |
getIgnoreNodata()
Returns the Ignore NoData in calculations parameter of this tool . |
java.lang.Object |
getInRaster()
Returns the Input raster parameter of this tool . |
java.lang.Object |
getNeighborhood()
Returns the Neighborhood parameter of this tool . |
java.lang.Object |
getOutRaster()
Returns the Output raster parameter of this tool . |
java.lang.String |
getStatisticsType()
Returns the Statistics type 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 |
setIgnoreNodata(java.lang.String ignoreNodata)
Sets the Ignore NoData in calculations parameter of this tool . |
void |
setInRaster(java.lang.Object inRaster)
Sets the Input raster parameter of this tool . |
void |
setNeighborhood(java.lang.Object neighborhood)
Sets the Neighborhood parameter of this tool . |
void |
setOutRaster(java.lang.Object outRaster)
Sets the Output raster parameter of this tool . |
void |
setStatisticsType(java.lang.String statisticsType)
Sets the Statistics type parameter of this tool . |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BlockStatistics
public BlockStatistics()
- Creates the Block Statistics tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
BlockStatistics
public BlockStatistics(java.lang.Object inRaster,
java.lang.Object outRaster)
- Creates the Block Statistics 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:
inRaster - Composite Geodataset, the raster to perform the Block Statistics calculations on.outRaster - Raster Dataset, the raster to be created.
getInRaster
public java.lang.Object getInRaster()
- Returns the Input raster parameter of this tool .
This parameter is Composite Geodataset, the raster to perform the Block Statistics calculations on.
This is a required parameter.
- Returns:
- the Input raster
setInRaster
public void setInRaster(java.lang.Object inRaster)
- Sets the Input raster parameter of this tool .
This parameter is Composite Geodataset, the raster to perform the Block Statistics calculations on.
This is a required parameter.
- Parameters:
inRaster - Composite Geodataset, the raster to perform the Block Statistics calculations on.
getOutRaster
public java.lang.Object getOutRaster()
- Returns the Output raster parameter of this tool .
This parameter is Raster Dataset, the raster to be created.
This is a required parameter.
- Returns:
- the Output raster
setOutRaster
public void setOutRaster(java.lang.Object outRaster)
- Sets the Output raster parameter of this tool .
This parameter is Raster Dataset, the raster to be created.
This is a required parameter.
- Parameters:
outRaster - Raster Dataset, the raster to be created.
getNeighborhood
public java.lang.Object getNeighborhood()
- Returns the Neighborhood parameter of this tool .
This parameter is Neighborhood, the default neighborhood is a square RECTANGLE with a width and height of three cells.
This is an optional parameter.
- Returns:
- the Neighborhood
setNeighborhood
public void setNeighborhood(java.lang.Object neighborhood)
- Sets the Neighborhood parameter of this tool .
This parameter is Neighborhood, the default neighborhood is a square RECTANGLE with a width and height of three cells.
This is an optional parameter.
- Parameters:
neighborhood - Neighborhood, the default neighborhood is a square RECTANGLE with a width and height of three cells.-
ANNULUS, {inner_radius}, {outer_radius}, {CELL | MAP} A torus (donut-shaped) neighborhood defined by an {inner_radius} and an {outer_radius}.
-
CIRCLE, {radius}, {CELL | MAP} A circular neighborhood with the given {radius}. The default is three cells.
-
RECTANGLE, {width}, {height}, {CELL | MAP} A rectangular neighborhood with the given {height} and {width}. The default rectangle is a square of width 3 and height 3, in units of cells. If only one of {width} or {height} is specified, the result is a square.
-
WEDGE, {start_angle}, {end_angle}, {radius}, {CELL | MAP} A wedge-shaped neighborhood. A wedge is specified by a {start_angle}, an {end_angle}, and a {radius}. The wedge extends counterclockwise from the starting angle to the ending angle. Angles are specified in degrees, with 0 or 360 representing east. Negative angles may be used.
-
IRREGULAR, kernel_file A custom neighborhood with specifications set by a user-defined file.
-
WEIGHT, kernel_file A custom neighborhood defined with an user-defined file, which can apply weights to the members of the neighborhood. Only the Mean, Standard Devation and Sum statistics types are available with the Weight neighborhood.
-
{CELL | MAP} Defines the units as either {CELL} or {MAP}.
getStatisticsType
public java.lang.String getStatisticsType()
- Returns the Statistics type parameter of this tool .
This parameter is String, the default statistic type is MEAN.
This is an optional parameter.
- Returns:
- the Statistics type
setStatisticsType
public void setStatisticsType(java.lang.String statisticsType)
- Sets the Statistics type parameter of this tool .
This parameter is String, the default statistic type is MEAN.
This is an optional parameter.
- Parameters:
statisticsType - String, the default statistic type is MEAN.-
MEAN Calculates the mean (average value) of the inputs.
-
MAJORITY Calculates the majority (value that occurs most often) of the inputs.
-
MAXIMUM Calculates the maximum (largest value) of the inputs.
-
MEDIAN Calculates the median value of the inputs.
-
MINIMUM Calculates the minimum (smallest value) of the inputs.
-
MINORITY Calculates the minority (value that occurs least often) of the inputs.
-
RANGE Calculates the range (difference between the largest and smallest value) of the inputs.
-
STD Calculates the standard deviation of the inputs.
-
SUM Calculates the sum (total of all values) of the inputs.
-
VARIETY Calculates the variety (the number of unique values) of the inputs.
getIgnoreNodata
public java.lang.String getIgnoreNodata()
- Returns the Ignore NoData in calculations parameter of this tool .
This parameter is String, denotes whether NoData values are ignored by the statistic calculation.
This is an optional parameter.
- Returns:
- the Ignore NoData in calculations
setIgnoreNodata
public void setIgnoreNodata(java.lang.String ignoreNodata)
- Sets the Ignore NoData in calculations parameter of this tool .
This parameter is String, denotes whether NoData values are ignored by the statistic calculation.
This is an optional parameter.
- Parameters:
ignoreNodata - String, denotes whether NoData values are ignored by the statistic calculation.-
DATA Specifies that if a NoData value exists within a neighborhood, the NoData value will be ignored. Only cells within the neighborhood that have data values will be used in determining the maximum value.
-
NODATA Specifies that if any cell in a neighborhood has a value of NoData, the output for each cell in the corresponding block will receive NoData. Whenever the NoData keyword is used, the presence of a NoData value implies that there is insufficient information to determine the maximum of the values of the neighborhood.
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