I just updated the r.forestfrag addon for GRASS GIS. The addon, which I described before, was developed based on an script by Sylla consult, and can be used to characterizes the degree of fragmentation following the approach proposed by Riiters et al. (2000). It identifies six categories of fragmentation, viz., interior, perforated, edge, transitional, patch, and undetermined, based on the amount of forest and its occurrence as adjacent forest pixels within a user-defined distance (i.e., the user sets the size of moving window used to compute the index).
The addon assumed that the input map had only two values, viz., 1 (forest) or no-forest (0). It did therefore not handle properly no-data areas. This meant that for example rivers or other water bodies had to be classified as no-forest. The possibly unintended results was that forest areas adjacent to these rivers or coastal lines would be classified as perforated or edge, while in reality these should be considered as forest interior. With the new update, no-data (NULL) raster cells are ignored. Thus, if one wants e.g., rivers to be excluded, one can mask them out (classify them as no-data) in the input layer.
In the example below, I am creating a forest fragmentation map for south America. As input I use the IGBP Land Cover map from the South America Land Cover Characteristics Data Base Version 2.0.
First I reclassified this map into a binary map with forest – non-forest, whereby I masked out all water areas. Next, I ran the r.forestfrag with moving window size of 9. With the ‘s’ flag set, the addon also generates a report showing the areas (in ha) for each fragmentation class.
MAP="saigbpl20@PERMANENT" r.reclass input=saigbpl20 output=forest << EOF 0 = 0 1 thru 5 = 1 6 thru 16 = 0 * = NULL EOF r.mapcalc "forest = forest" --overwrite r.forestfrag -s input=forest output=frag window=9
The resulting maps shows the six fragmentation categories and the water bodies (darkblue). In the inset, you can see that there are areas classified as ‘interior’ up to the water body, i.e., these rivers are ignored when the fragmentation index is computed.
The user can opt to print out the summary area statistics for this map by setting the ‘s’ flag. All this does is to run r.stats so you can of course do this afterwards yourself as well.