Show Navigation | Hide Navigation
You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Zonal (Spatial Analyst)

ZonalStats

Release 9.2
Last modified January 3, 2008
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Zonal (Spatial Analyst)"


Related Topics

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

ZonalStats illustration

Usage tips

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:
  • MEAN  — Zonal mean calculations (ZonalMean)
  • MIN  — Zonal minimum calculations (ZonalMin)
  • MAX  — Zonal maximum calculations (ZonalMax)
  • RANGE  — Zonal range calculations (ZonalRange)
  • SUM  — Zonal sum calculations (ZonalSum)
  • STD  — Zonal standard deviation calculations (ZonalStd)
  • VARIETY  — Zonal variety calculations (ZonalVariety)
  • MAJORITY  — Zonal majority calculations (ZonalMajority)
  • MINORITY  — Zonal minority calculations (ZonalMinority)
  • MEDIAN  — Zonal median calculations (ZonalMedian)
  • ALL  — Returns the Mean, Min, Max, Range, Sum, Std, Variety, Majority, and Median zonal calculations
  • EXTREME  — Returns the Min and Max zonal calculations
  • MOMENT  — Returns the Mean and Std zonal calculations

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.
  • DATA  — A keyword that specifies that if a NoData value exists in a cell on the value raster within any particular zone defined by <zone_grid>, the cell will be ignored, and only cells on the value raster that have data values within the zone will be used to determine the mean for the output.
  • NODATA  — A keyword that signifies that if a NoData value exists on the value raster within any particular zone defined by <zone_grid>, there is insufficient information to complete the calculation to determine the mean of the values for all the cells within the zone, and the entire zone will receive the NoData value on the output raster.

Map Algebra example

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

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.