DEM-Hydro Processing scripts

Class coverage statistics

The Class coverage statistics script crosses a selected catchment from a merged catchments map with a raster map that has a class domain, for instance land use classes or land cover classes.

Then, for each class, the area in percentages is calculated, i.e. the area that is occupied by each class in the selected catchment. The output is stored in column area_percent.

When the script is finished, the output cross table is displayed.

Dialog box options:

Merged catchment map:

Select a raster map that is the result of a previous Catchment Merge operation.

Selected catchment ID:

Type the ID of a catchment with which you wish to perform the cross.

Cross map:

Select a raster map with a class domain, for instance a land use map or land cover map. The merged catchments map will be crossed with the raster map selected here.

Output table:

Type a name for the output cross table that will contain the statistics on your landuse or landcover classes.

Short explanation of the calculations by the script:

  1. A temporary (bool) map is created which only contains the selected catchment.
  2. This map is crossed with your class map.
  3. In the resulting cross table, a temporary column is calculated to obtain the sum of the total area:
  4.  

    temp_col_sum = ColumnAggregateSum(NPix)

     

    The script calculates with NPix, so that even if you use a map with geographic LatLon coordinates, answers will be obtained.

  5. Then, for each class, the percentage of the area that is occupied by this class in the selected catchment is calculated:
  6.  

    output column area_percent = (NPix / temp_col_sum) * 100

     

  7. Finally, the temporary raster map and the temporary column are removed, and the output cross table is shown.

Tip:

For more information on the TabCalc functions used in this script, please refer to the following topics: ColumnAggregateSum / AGGSUM, or to Map and Table Calculation.

See also: