Skip to main content

Calculate Zonal Statistics

Overview

Calculate raster cell statistics by vector zone and write the results to the output vector attribute table.

Zonal statistics uses vector zones as spatial grouping units. It calculates statistics such as sum, mean, and count for the cells covered by each zone, then writes the results back to the attribute table of the output features.

Use Cases

  • Summarize elevation, rainfall, temperature, or vegetation-index rasters by administrative boundary, watershed, or planning zone.
  • Produce per-zone indicators for reports, thematic maps, or model inputs.
  • Improve efficiency for batch processing, repeated runs, or standardized delivery.

Parameters

ParameterDescriptionNotes
Input raster fileRaster data for zonal statisticsRequired
Input vector zone fileVector boundary file used as zonesRequired
Statistics methodsStatistical methods for raster cells within each zoneRequired; default: ['sum']; options include sum (sum), mean (mean), maximum (max), minimum (min), standard deviation (std), variance (var), median (median), count (count), and others
Include all touched cellsIf True, includes all cells touched by a zone boundary. If False, includes only cells whose center points are inside the zoneOptional; default: False
Output vector fileOutput vector file containing zonal statistics resultsRequired

Steps

  1. Start the tool: Open Geoprocessing Toolbox → Spatial Analysis Tools > Regional Analysis, then start the Calculate Zonal Statistics tool pane.
  2. Prepare input: Select the Input raster file and Input vector zone file, then confirm that both datasets are complete and readable.
  3. Set core parameters: Configure Statistics methods and Include all touched cells based on the reporting requirement.
  4. Set output: Specify the Output vector file and confirm that the output path, format, and naming rules meet downstream requirements.
  5. Run and inspect the result: Click Run, then check the output attribute table and verify that statistics were written for each zone as expected.

Notes

  • The raster and zone layer should use compatible coordinate systems and spatial extents.
  • The Include all touched cells option can change results along zone boundaries, especially for small zones or coarse rasters.
  • NoData cells are usually excluded from statistics; confirm this behavior before using the results for reporting.