Feature Description
The Zonal Statistics tool performs raster value statistics on a raster dataset based on specific zonal ranges. This method divides raster data according to specified zones (regardless of cell adjacency) and calculates statistical values for cells within the same zone. The output is a new raster dataset where all cells in the same zone are assigned identical statistical values.
Supports multiple statistical modes: Minimum, Maximum, Mean, Standard Deviation, Sum, Range, and Median. The following example demonstrates the effect when using the maximum value statistical mode with "Ignore NoData" enabled. As shown, NoData cells are excluded from computation, and only valid-value cells determine the output zonal value.
Parameter Description
Parameter | Description | Type |
---|---|---|
Zonal Data | Zone-defining dataset, which can be either polygon vector data or raster data. Note: Raster datasets as zonal data currently only support pixel formats: 1-bit (UBit1), 4-bit (UBit4), 8-bit (UBit8), and 16-bit (Bit16). |
Dataset |
Value Data | Target raster dataset to be statistically analyzed. | Dataset |
Statistical Mode | Selection of statistical calculation method, including: Minimum, Maximum, Mean, Standard Deviation, Sum, Range, and Median. | GridStatisticsMode |
Zone Identifier Field | Mandatory field for polygon vector zonal data. Only 32-bit integer fields are supported. The SMID field is used by default. | String |
Ignore NoData | Determines whether to exclude NoData cells in statistical computation. - Checked: Excludes NoData cells, using only valid-value cells to determine zonal output. - Unchecked: Retains NoData cells in the output raster. |
Boolean |
Target Datasource | Specifies the datasource for storing the result raster dataset. | Datasource |
Result Dataset Name | Name of the output raster dataset. Default: result_ZonalStatisticsGrid. | String |
Result Attribute Table Name (Optional) |
Name of the statistical result attribute table. Default: result_ZonalStatisticsTable. Leave blank to disable table output. | String |
Output
Parameter | Description | Type |
---|---|---|
Raster Dataset | Output zonal statistics raster dataset where all cells in the same zone share identical statistical values. | DatasetGrid |
Table | Statistical result attribute table containing all statistical mode results and pixel counts (PixelCount) per zone. | DatasetVector |
Application Examples
Zonal Statistics has wide applications across domains, such as:
- Calculating average population density within pollution zones
- Identifying vegetation types at specific elevation ranges
- Analyzing land use patterns within slope categories
The example below demonstrates calculating average elevation across different slope categories. Inputs include:
- Slope classification raster as Zonal Data
- Elevation raster as Value Data
- Statistical mode: Mean
The output raster is shown below:
Notes
- Polygons sharing the same identifier field value are treated as a single zone. These will merge into one record in the result attribute table and share identical values in the output raster.
- Overlapping polygons in vector zonal data will be rasterized. During this process, overlapping areas will adopt the attribute of the last polygon in the dataset.