Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.
Figure: Illustration for a custom 3x3 filter
The filter is applied repeat times (default value is 1). The output raster map layer can be given a TITLE if desired. (This TITLE should be put in quotes if it contains more than one word.)
With -z flag the filter is applied only to null values in the input raster map layer. The non-null category values are not changed. Note that if there is more than one filter step, this rule is applied to the intermediate raster map layer -- only null category values which result from the first filter will be changed. In most cases this will NOT be the desired result. Hence -z should be used only with single step filters.
The filter parameter defines the name of an existing, user-created UNIX ASCII file whose contents is a matrix defining the way in which the input file will be filtered. The format of this file is described below, under FILTERS.
The repeat parameter defines the number of times the filter is to be applied to the input data.
TITLE TITLE MATRIX n . n lines of n values . DIVISOR d TYPE S/P
Sequential filtering happens in place. As the filter is applied to the raster map layer, the category values that were changed in neighboring cells affect the resulting category value of the current cell being filtered.
Parallel filtering happens in such a way that the original raster map layer category values are used to produce the new category value.
More than one filter may be specified in the filter file. The additional filter(s) are described just like the first. For example, the following describes two filters:
TITLE 3x3 average, non-null data only, followed by 5x5 average MATRIX 3 1 1 1 1 1 1 1 1 1 DIVISOR 0 TYPE P MATRIX 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DIVISOR 25 TYPE P
If more than one filter step is specified, either because the repeat value was greater than one or because the filter file contained more than one matrix, these steps are performed sequentially. This means that first one filter is applied to the entire input raster map layer to produce an intermediate result; then the next filter is applied to the intermediate result to produce another intermediate result; and so on, until the final filter is applied. Then the output cell is written.
By specifying the number of parallel processes with nprocs option, r.mfilter can run significantly faster, see benchmarks below.
Note that parallelization is implemented only for the parallel filter, not the sequential one. To take advantage of the parallelization, GRASS GIS needs to compiled with OpenMP enabled.
Available at: r.mfilter source code (history)
Latest change: Monday May 16 17:29:31 2022 in commit: 97ee1fdf94b7081ed41f94495093032b285e56e2
Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
© 2003-2023 GRASS Development Team, GRASS GIS 8.2.2dev Reference Manual