Filtering and clumping
In this section, and the following one, we move on from the subject of changing raster geometry to the subject of relations between neighboring raster cell values. These relations can be summarized in the form of a new raster using a variety of methods. In this section, we will introduce two such methods: focal filtering and clumping.
Focal filtering involves assigning in each cell of a raster (the focal cell) the result of a function, whose input is the set of values from a neighborhood of cells surrounding the focal one (including itself). The neighborhood size is predetermined (for example, a neighborhood of 3*3 cells is commonly used), and the input raster is scanned in a moving window manner until complete coverage has been reached. There are many appropriate functions that can be implemented in filters for various purposes. For example, using the mean
function (also known as a low-pass filter) makes an image look smoother, while using a function that finds the...