regional statistics

Feature Description

The regional statistics tool performs raster value statistics on a raster dataset based on specific regional ranges. It divides raster data according to regions without considering the adjacency of raster cells, conducts statistics on cells within the same region, and ultimately generates a new raster dataset. In the result dataset, raster cells within the same region are assigned the same statistical value.

It supports multiple statistical models, including minimum, maximum, average, standard deviation, sum, range, minority, mode, variety, and median. The following example shows the effect when using the maximum statistical model and checking 'Ignore No Value'. It can be seen that no-value pixels do not participate in the summary operation, and only pixels with values are used to determine the output value for the region.

Parameter Description

Parameter Name Parameter Interpretation Parameter Type
zonal data Area dataset, which can be a vector surface dataset or a raster dataset. If selecting a raster dataset as zonal data, note that currently only raster datasets with pixel formats of 1-bit (UBit1), 4-bit (UBit4), single-byte (UBit8), and double-byte (Bit16) are supported. Dataset
Value Data Raster data to be counted. Dataset
Statistical Model Select a statistical model, including minimum, maximum, average, standard deviation, sum, range, minority, mode, variety, and median. Note: Statistics for minority, mode, and variety are not supported for raster data with floating-point pixel format. GridStatisticsMode
Area Identification Field When the area dataset is vector surface data, the field used to identify regions, with type only supporting int. By default, the SMID field of the vector dataset is used for statistics. String
Ignore Null Values Whether to ignore no-value pixels in the raster data to be counted. "Checked" means no-value pixels do not participate in statistical operations, and only pixels with values are used to determine the output value for the region; "Unchecked" means the output result raster still contains no-value pixels. Boolean
Target Datasource
(Optional)
Specify the datasource to store the result raster dataset. Datasource
The Name of the Resulting Dataset
(Optional)
Specify the name of the result raster dataset, defaulting to result_ZonalStatisticsGrid. If left blank, no resulting grid data will be output.
Note: The name of the result raster dataset and the attribute table name cannot both be empty; at least one must be filled in.
String
Target Property Sheet Datasource
(Optional)
Specify the datasource to store the result table. Datasource
The Name of the Resulting Property Table
(Optional)
Specify the name of the statistical result table, defaulting to result_ZonalStatisticsTable. If left blank, no result table will be output. String

Output Result

Parameter Name Parameter Interpretation Parameter Type
Raster Dataset Regional statistics result raster dataset, where raster cells within the same region have the same statistical value. DatasetGrid
Attribute Table Result table, outputting the statistical result table for regions according to the statistic field. It includes results for all statistical models and the number of cells within the region (PixelCount), facilitating the viewing of statistics information for each region. DatasetVector

Application Example

Regional statistics can be widely applied in various fields, such as calculating the average population density within each pollution zone, vegetation types at the same elevation, land use types within the same slope area, etc. The following example calculates the average elevation for different slope categories in a region. First, prepare slope classification raster data and elevation data as inputs for the zonal data and value data of the 【Regional Statistics】 tool, respectively. Then, select "Average" as the statistical model. The final output resulting grid data is shown in the figure below.

Precautions

  1. Faces with the same identifies the field value are treated as the same region during statistics and appear as one record in the statistical result table. The covered result raster cell values are equal.
  2. When there are overlapping faces in the regional vector surface dataset, because the face data will be rasterized first, only the last face will be counted in the overlapping area during the statistical process. <<<<<<< HEAD
  3. <strong>Function Change</strong>: Since SuperMap 2025 version, statistics for minority, mode, and variety are no longer supported for raster data with floating-point pixel format, and the logic of the following three statistical methods has been optimized:
    Function Change: Since SuperMap 2025 version, statistics for minority, mode, and variety are no longer supported for raster data with floating-point pixel format, and the logic of the following three statistical methods has been optimized:
  4. Function Change: Since SuperMap 2025 version, statistics for minority, mode, and variety are no longer supported for raster data with floating-point pixel format, and the logic of the following three statistical methods has been optimized:

    ef053974c5d328c65d8739a5e154f89bb0d70689

    • Median: Approximate calculation is used for massive floating-point statistics (e.g., test3, test6). When the count within a region exceeds 1 million, a warning log is output: "The median, mode, minority, and variety statistical values for the region may be approximate calculation results";
    • Minority: Takes the minimum value among the least frequent values;
    • Mode: Takes the minimum value among the most frequent values.