Zonal Statistics function

Available with Image Analyst license.

Available with Spatial Analyst license.

Overview

Calculates statistics on values of a raster within the zones of another dataset.

A zone is defined as all areas in the input that have the same value. These areas do not have to be contiguous. When the zone and value inputs are both rasters of the same resolution, they will be used directly. If the resolutions are different, an internal resampling is applied to make the resolutions match before the zonal operation is performed.

Zonal Statistics illustration
Zonal Statistics minimum statistics type example.

For more information, see the How Zonal Statistics works topic in the Spatial Analyst tool help.

This is a global raster function.

Notes

The Zone Raster must be an integer raster input. If you have feature zones, you must convert the feature into a raster before it can be used in this function. While performing the conversion, use the cell size and snap raster environment of the Value Raster.

When specifying the input zone data, the default Zone Field will be the first available integer or text field.

The Value Raster can be either integer or floating point. However, when it is floating-point type, the zonal calculations for Majority, Median, Minority, Percentile, and Variety will not be computed.

The data type of the output is dependent on the zonal calculation being performed and the input Value Raster type. See How Zonal Statistics works for more information.

For Majority and Minority calculations, when there is a tie, the output for the zone is based on the lowest of the tied values.

Parameters

Parameter nameDescription

Zone Raster

(Required)

Dataset that defines the zones. The zones can be defined by an integer raster.

Zone Field

(Required)

Field that holds the values that define each zone. It can be an integer or a string field of the zone raster.

Value Raster

(Required)

Raster that contains the values on which to calculate a statistic.

Statistics Type

Statistic type to be calculated.

  • Mean—Calculates the average of all pixels in the Value Raster that belong to the same zone as the output pixel.
  • Majority—Determines the value that occurs most often of all pixels in the Value Raster that belong to the same zone as the output pixel.
  • Maximum—Determines the largest value of all pixels in the Value Raster that belong to the same zone as the output pixel.
  • Median—Determines the median value of all pixels in the Value Raster that belong to the same zone as the output pixel.
  • Minimum—Determines the smallest value of all pixels in the Value Raster that belong to the same zone as the output pixel.
  • Minority—Determines the value that occurs least often of all pixels in the Value Raster that belong to the same zone as the output pixel.
  • Percentile—Calculates a percentile of all pixels in the Value Raster that belong to the same zone as the output pixel. The 90th percentile is calculated by default. You can determine which percentile to calculate with the Percentile Value parameter.
  • Range—Calculates the difference between the largest and smallest value of all pixels in the Value Raster that belong to the same zone as the output pixel.
  • Standard Deviation—Calculates the standard deviation of all pixels in the Value Raster that belong to the same zone as the output pixel.
  • Sum—Calculates the total value of all pixels in the Value Raster that belong to the same zone as the output pixel.
  • Variety—Calculates the number of unique values for all pixels in the Value Raster that belong to the same zone as the output pixel.

Ignore NoData in calculations

Denotes whether NoData values in the Value Raster will influence the results of the zone that they fall within.

  • Yes—Within any particular zone, only pixels that have a value in the Value Raster will be used in determining the output value for that zone. NoData pixels in the Value Raster will be ignored in the statistic calculation. This is the default.
  • No—Within any particular zone, if any NoData pixels exist in the Value Raster, it is deemed that there is insufficient information to perform statistical calculations for all the pixels in that zone; therefore, the entire zone will receive the NoData value on the output raster.

Process as multidimensional

Determines how the input multidimensional value raster is processed.

  • Current Slice—Statistics will be calculated from the current slice of a multidimensional dataset. This is the default.
  • All Slices—Statistics will be calculated for all dimensions (such as time or depth) of a multidimensional dataset.

Percentile Value

The percentile to calculate. The default is 90, for the 90th percentile.

The values can range from 0 through 100. The 0th percentile is essentially equivalent to the Minimum statistic, and the 100th percentile is equivalent to Maximum. A value of 50 will produce essentially the same result as the Median statistic.

Environment settings

Geoprocessing environment settings for global functions are controlled at the application level. Setting processing environments in ArcGIS Pro can be done by clicking the Environments button on the Analysis tab. See Analysis environments and Spatial Analyst for additional details on environment settings.

The following environments are supported by this global function:

Related topics