Tool Zonal Grid Statistics
The tool allows one to calculate zonal statistics over a set of input grids and reports the statistics in a table.
The tool first creates a contingency table of unique condition units (UCUs) on which the statistics are calculated. These UCUs are delineated from a zonal grid (e.g. sub catchments) and optional categorical grids (e.g. landcover, soil, ...). The derived UCUs can be output as a grid dataset.
The tool then calculates descriptive statistics (n, min, max, mean, standard deviation and sum) for each UCU from (optional) grids with continious data (e.g. slope). A grid storing aspect must be treated specially (circular statistics), please use the "Aspect" input parameter for such a grid.
The tool has four different modes of operation:
(1) only a zonal grid is used as input. This results in a simple contingency table with the number of grid cells in each zone.
(2) a zonal grid and additional categorical grids are used as input. This results in a contingency table with the number of cells in each UCU.
(3) a zonal grid and additional grids with continuous data are used as input. This results in a contingency table with the number of cells in each zone and the corresponding statistics for each continuous grid.
(4) a zonal grid, additional categorical grids and additional grids with continuous data are used as input. This results in a contingency table with the number of cells in each UCU and the corresponding statistics for each continuous grid.
Depending on the mode of operation, the output table contains information about the categorical combination of each UCU, the number of cells in each UCU and the statistics for each UCU. A typical output table may look like this:
ID UCU | ID Zone | ID 1stCat | ID 2ndCat | Count UCU | N 1stCont | MIN 1stCont | MAX 1stCont | MEAN 1stCont | STDDEV 1stCont | SUM 1stCont |
1 | 0 | 2 | 6 | 6 | 6 | 708.5 | 862.0 | 734.5 | 62.5 | 4406.8 |
2 | 0 | 3 | 4 | 106 | 106 | 829.1 | 910.1 | 848.8 | 28.5 | 89969.0 |
Note: in the case you like to convert some one of the statistics back to a grid dataset, you can use the following procedure. Run the tool and output the UCU grid. Then edit the output table to match your needs (delete all fields besides the UCU identifier and the fields you like to create grids from). Then use both datasets in the "Grids from Classified Grid and Table" tool.
- Author: Volker Wichmann (c) 2005-2022
- Menu: Spatial and Geostatistics|Grids
Parameters
| Name | Type | Identifier | Description | Constraints |
Input | Zone Grid | Grid, input | ZONES | The grid defining the zones to analyze [NoData;categorical values]. | - |
Categorical Grids (*) | Grid list, input, optional | CATLIST | Additional grids used to delineate the UCUs [NoData;categorical values]. | - |
Grids to Analyse (*) | Grid list, input, optional | STATLIST | The grids with continuous data for which the statistics are calculated [NoData;continuous values]. | - |
Aspect (*) | Grid, input, optional | ASPECT | A grid encoding the aspect of each cell [radians]. | - |
Output | UCUs (*) | Grid, output, optional | UCU | The derived unique condition areas (UCU). | - |
Zonal Statistics | Table, output | OUTTAB | The summary table with the statistics for each UCU. | - |
Options | Grid System | Grid system | PARAMETERS_GRID_SYSTEM | - | - |
Short Field Names | Boolean | SHORTNAMES | Shorten the field names to ten characters (as this is the limit for field names in shapefiles). | Default: 1 |
(*) optional |
Command-line
Usage: saga_cmd statistics_grid 5 [-ZONES <str>] [-CATLIST <str>] [-STATLIST <str>] [-ASPECT <str>] [-UCU <str>] [-OUTTAB <str>] [-SHORTNAMES <str>]
-ZONES:<str> Zone Grid
Grid, input
-CATLIST:<str> Categorical Grids
Grid list, input, optional
-STATLIST:<str> Grids to Analyse
Grid list, input, optional
-ASPECT:<str> Aspect
Grid, input, optional
-UCU:<str> UCUs
Grid, output, optional
-OUTTAB:<str> Zonal Statistics
Table, output
-SHORTNAMES:<str> Short Field Names
Boolean
Default: 1