3.10. Post-processing and Analysis

Image recode tool

Tool: recode_8bit.exe

Description: The tool recodes values in the 8-bit unsigned raster file.

Installation: Download utility recode_8bit.exe to C:/GLAD_1.0

Usage:

  • Create a text file that contains a recode table. See this file as an example: recode_table.txt. Each line of the recode table file has three elements: the minimal value in the input range, the maximal value in the input range, and the output value. The example file contains the table to recode likelihood file into a mask with values 0 (background class) and 1 (target class).
  • Open CMD. Navigate to the new classification workspace. Perform the following command:

C:/GLAD_1.0/recode_8bit.exe <input>.tif <output>.tif recode_table.txt


Area calculation tool

Tool: get_area.exe

Description: Calculate the area and pixel count. The input file should be 8-bit unsigned raster file.

Installation: Download utility get_area.exe to C:/GLAD_1.0

Usage:

  • Open CMD. Navigate to the new classification workspace. Perform the following command:

C:/GLAD_1.0/get_area.exe <input>.tif

  • The output recorded as “area_report.txt” file

Zonal statistics tool

Tool: zonal_stat.exe

Description: Calculate the area of target pixel classes within zones defined by another raster layer. Both input files should have the same size and coordinate and both should be in 8-bit unsigned format.

Installation: Download utility zonal_stat.exe to C:/GLAD_1.0

Usage:

The first step is to create a zonal raster file. The example below provides a solution to create a zonal raster from vector map using GDAL tools. Other solutions are possible as well.

  • Make sure that the zonal shapefile has a separate database field with zones IDs, that zones IDs are not exceeding 255, and that the vector projection is +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs.
  • Open OCGeo4W and navigate to the work folder.
  • Use GDAL gdalinfo tool to get the input raster extent and resolution:
    • Use command: gdalinfo <input raster>.tif >fileparam.txt
    • Open fileparam.txt to get UL/LR coordinates and pixel size
  • Use gdal_rasterize to make the raster zone file:
    • gdal_rasterize -te ulx lry lrx uly -tr 0.00025 0.00025 -ot Byte -of GTiff -co COMPRESS=LZW -co BIGTIFF=IF_SAFER -a gird vector_zones.shp raster_zones.tif

The second step is to run the area calculation. It requires two files: source map and zones, both in the same format and extent.

  • Open CMD. Navigate to the new classification workspace. Perform the following command:

C:/GLAD_1.0/zonal_stat.exe <input>.tif <zonal>.tif

  • The output recorded as “zonal_area_report.txt” file.