com.esri.arcgis.geoprocessing.tools.datamanagementtools
Class CalculateStatistics
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.datamanagementtools.CalculateStatistics
- All Implemented Interfaces:
- GPTool
public class CalculateStatistics
- extends AbstractGPTool
Calculates statistics for a raster dataset or mosaic dataset.
The Calculate Statistics tool is contained in the Data Management Tools tool box.
Usage tips:
- Calculating allows ArcGIS applications to properly stretch and symbolize raster data for display.
- A skip factor controls the portion of the raster dataset that is used when calculating the statistics. The input value indicates the horizontal or vertical skip factor, where a value of 1 will use each pixel and a value of 2 will use every second pixel. The skip factor can only range from 1 to the number of columns/rows in the raster dataset.
- The skip factors for raster datasets stored in a file geodatabase or an ArcSDE geodatabase are quite different. First, if the x and y skip factors are different, the smaller skip factor will be used for both the x and y skip factors. Second, the skip factor is related to the pyramid level that most closely fits the skip factor chosen. If the skip factor value is not equal to the number of pixels in a pyramid (for example, if the skip factor is 5 and the closest pyramid level is 4 x 4 pixels, which is level 2), the software will round down to the next pyramid level (in this case, 2) and use that value as the skip factor.
- A skip factor is not used for all raster formats. The raster formats that cannot use the skip factor include ADRG, CIB, and CADRG.
- When using this tool to calculate statistics on a mosaic dataset, the statistics are calculate for the top-level mosaicked image, not for every raster contained within the mosaic dataset.
- Specifying a skip factor for a mosaic dataset is highly recommended as these datasets tend to be very large.
- The Ignore Values option allows you to exclude a specific value from the calculation of statistics. You may want to ignore a value if it is a NoData value or if it will skew your calculation.
- Calculating statistics on the GRID and the RADARSAT2 formats alway uses a skip factor of 1.
Constructor Summary |
CalculateStatistics()
Creates the Calculate Statistics tool with defaults. |
CalculateStatistics(java.lang.Object inRasterDataset)
Creates the Calculate Statistics tool with the required parameters. |
Method Summary |
java.lang.Object |
getIgnoreValues()
Returns the Ignore Values parameter of this tool . |
java.lang.Object |
getInRasterDataset()
Returns the Input Raster Dataset parameter of this tool . |
java.lang.Object |
getOutRaster()
Returns the Output Raster Dataset parameter of this tool (Read only). |
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. |
int |
getXSkipFactor()
Returns the Number of Columns to Skip parameter of this tool . |
int |
getYSkipFactor()
Returns the Number of Rows to Skip parameter of this tool . |
void |
setIgnoreValues(java.lang.Object ignoreValues)
Sets the Ignore Values parameter of this tool . |
void |
setInRasterDataset(java.lang.Object inRasterDataset)
Sets the Input Raster Dataset parameter of this tool . |
void |
setXSkipFactor(int xSkipFactor)
Sets the Number of Columns to Skip parameter of this tool . |
void |
setYSkipFactor(int ySkipFactor)
Sets the Number of Rows to Skip parameter of this tool . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CalculateStatistics
public CalculateStatistics()
- Creates the Calculate Statistics tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
CalculateStatistics
public CalculateStatistics(java.lang.Object inRasterDataset)
- Creates the Calculate 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:
inRasterDataset
- the input raster dataset or mosaic dataset.
getInRasterDataset
public java.lang.Object getInRasterDataset()
- Returns the Input Raster Dataset parameter of this tool .
This parameter is the input raster dataset or mosaic dataset.
This is a required parameter.
- Returns:
- the Input Raster Dataset
setInRasterDataset
public void setInRasterDataset(java.lang.Object inRasterDataset)
- Sets the Input Raster Dataset parameter of this tool .
This parameter is the input raster dataset or mosaic dataset.
This is a required parameter.
- Parameters:
inRasterDataset
- the input raster dataset or mosaic dataset.
getXSkipFactor
public int getXSkipFactor()
- Returns the Number of Columns to Skip parameter of this tool .
This parameter is the number of horizontal pixels between samples. the value must be greater than zero and less than or equal to the number of columns in the raster dataset. The default is 1 or the last skip factor used. the skip factors for raster datasets stored in a file geodatabase or an ArcSDE geodatabase are different. First, if the x and y skip factors are different, the smaller skip factor will be used for both the x and y skip factors. Second, the skip factor is related to the pyramid level that most closely fits the skip factor chosen. If the skip factor value is not equal to the number of pixels in a pyramid layer, the number is rounded down to the next pyramid level and those statistics are used.
This is an optional parameter.
- Returns:
- the Number of Columns to Skip
setXSkipFactor
public void setXSkipFactor(int xSkipFactor)
- Sets the Number of Columns to Skip parameter of this tool .
This parameter is the number of horizontal pixels between samples. the value must be greater than zero and less than or equal to the number of columns in the raster dataset. The default is 1 or the last skip factor used. the skip factors for raster datasets stored in a file geodatabase or an ArcSDE geodatabase are different. First, if the x and y skip factors are different, the smaller skip factor will be used for both the x and y skip factors. Second, the skip factor is related to the pyramid level that most closely fits the skip factor chosen. If the skip factor value is not equal to the number of pixels in a pyramid layer, the number is rounded down to the next pyramid level and those statistics are used.
This is an optional parameter.
- Parameters:
xSkipFactor
- the number of horizontal pixels between samples. the value must be greater than zero and less than or equal to the number of columns in the raster dataset. The default is 1 or the last skip factor used. the skip factors for raster datasets stored in a file geodatabase or an ArcSDE geodatabase are different. First, if the x and y skip factors are different, the smaller skip factor will be used for both the x and y skip factors. Second, the skip factor is related to the pyramid level that most closely fits the skip factor chosen. If the skip factor value is not equal to the number of pixels in a pyramid layer, the number is rounded down to the next pyramid level and those statistics are used.
getYSkipFactor
public int getYSkipFactor()
- Returns the Number of Rows to Skip parameter of this tool .
This parameter is the number of vertical pixels between samples. the value must be greater than zero and less than or equal to the number of rows in the raster. The default is 1 or the last y skip factor used. the skip factors for raster datasets stored in a file geodatabase or an ArcSDE geodatabase are different. First, if the x and y skip factors are different, the smaller skip factor will be used for both the x and y skip factors. Second, the skip factor is related to the pyramid level that most closely fits the skip factor chosen. If the skip factor value is not equal to the number of pixels in a pyramid layer, the number is rounded down to the next pyramid level and those statistics are used.
This is an optional parameter.
- Returns:
- the Number of Rows to Skip
setYSkipFactor
public void setYSkipFactor(int ySkipFactor)
- Sets the Number of Rows to Skip parameter of this tool .
This parameter is the number of vertical pixels between samples. the value must be greater than zero and less than or equal to the number of rows in the raster. The default is 1 or the last y skip factor used. the skip factors for raster datasets stored in a file geodatabase or an ArcSDE geodatabase are different. First, if the x and y skip factors are different, the smaller skip factor will be used for both the x and y skip factors. Second, the skip factor is related to the pyramid level that most closely fits the skip factor chosen. If the skip factor value is not equal to the number of pixels in a pyramid layer, the number is rounded down to the next pyramid level and those statistics are used.
This is an optional parameter.
- Parameters:
ySkipFactor
- the number of vertical pixels between samples. the value must be greater than zero and less than or equal to the number of rows in the raster. The default is 1 or the last y skip factor used. the skip factors for raster datasets stored in a file geodatabase or an ArcSDE geodatabase are different. First, if the x and y skip factors are different, the smaller skip factor will be used for both the x and y skip factors. Second, the skip factor is related to the pyramid level that most closely fits the skip factor chosen. If the skip factor value is not equal to the number of pixels in a pyramid layer, the number is rounded down to the next pyramid level and those statistics are used.
getIgnoreValues
public java.lang.Object getIgnoreValues()
- Returns the Ignore Values parameter of this tool .
This parameter is the pixel values that are not to be included in the statistics calculation. the default is no value, or the last ignore values used.
This is an optional parameter.
- Returns:
- the Ignore Values
setIgnoreValues
public void setIgnoreValues(java.lang.Object ignoreValues)
- Sets the Ignore Values parameter of this tool .
This parameter is the pixel values that are not to be included in the statistics calculation. the default is no value, or the last ignore values used.
This is an optional parameter.
- Parameters:
ignoreValues
- the pixel values that are not to be included in the statistics calculation. the default is no value, or the last ignore values used.
getOutRaster
public java.lang.Object getOutRaster()
- Returns the Output Raster Dataset parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the Output Raster Dataset
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