ZonalStats |
|
Release 9.2
Last modified January 3, 2008 |
Print all topics in : "Zonal (Spatial Analyst)" |
Records, in an output INFO table, the mean, minimum, maximum, range, sum, standard deviation, variety, majority, and median of the values of all cells in the value raster that belong to the same zone. Zones are identified by the values of the cells in the input zone raster.
Illustration
Usage tips
Map Algebra
The zone raster must be an integer raster.
The value raster can contain either integer or floating-point values. However, when the it is of floating-point type, the zonal calculations for majority, median, minority and variety will not be computed.
For majority and minority, when there is a tie, the output for all cell locations in the zone is assigned the lowest of the tied values.
The data type for each value under the items in the output table is dependent on the zonal calculation being performed (refer to the appropriate command reference for behavior of the output value types for each function).
The number of rows in the output table is the number of zones.
In the output table, three items always precede the items containing the zonal output calculations: value, count, and area. The value field contains the values of the zones defined by zone raster, count tells the number of cells in each zone, and area gives the area of each zone in square map units.
Any field in the output table can be used as a lookup item to create a raster containing the values.
Learn more about how to specify the input raster dataset in the Map Algebra expression of Raster Calculator.
Command line syntax
See Zonal Statistics as Table
Scripting syntax
See Zonal Statistics as Table
Map Algebra syntax
ZonalStats(<zone_grid>, <value_grid>, {stats_name}, {DATA | NODATA})
Parameter | Explanation |
<zone_grid> | An integer raster that identifies the zone for each cell.
The zone raster can be an expression resulting in a raster. |
<value_grid> | An integer or floating-point raster that defines the values of the cells in which the mean is to be calculated.
The mean of the values of the value raster in each zone will be assigned to every cell in that zone on the output raster. The value raster may be an expression resulting in a raster. |
{stats_name} | A keyword that defines which zonal calculations will be performed on the <zone_grid> and the <value_grid>. Valid input keyword arguments are:
If no arguments are given for {stats_name}, the default returns the Mean, Min, and Max zonal calculations. For complete information on the zonal calculations performed by each keyword above, refer to the functions listed in parentheses next to each keyword. The input keyword for {stats_name} defines the field names for the ZonalStats output table. For each zonal calculation performed by the specified keyword listed, an item with the appropriate zonal calculation name (the same as the keywords listed above) is created in the output table. |
{DATA | NODATA} | A keyword defining the manner in which NoData values on the <value_grid> that fall within a zone defined by the <zone_grid> will influence the output results.
|
zonalstats(zonegrid, valuegrid) zonalstats(zonegrid, valuegrid, min) zonalstats(zonegrid, valuegrid, range) zonalstats(zonegrid, valuegrid, all) zonalstats(zonegrid, (ingrid1 + ingrid2), extreme) zonalstats(zonegrid, valuegrid, moment)
ArcObjects syntax
See Zonal Statistics as Table