The filter type. *S* means sequential, while *P* mean parallel.
If not specified, the default is S.
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:

## EXAMPLE FILTER FILE

TITLE 3x3 average, non-zero 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

## HOW THE FILTER WORKS

The filter process produces a new category value for each cell
in the input raster map layer by multiplying the category values of the
cells in the n x n neighborhood around the center cell
by the corresponding matrix value and adding them together.
If a divisor is specified, the sum is divided by this divisor,
rounding to the nearest integer.
(If a zero divisor was specified, then
the divisor is computed for each cell as the sum of the MATRIX
values where the corresponding input cell is non-zero.)
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.

## NOTES

If the resolution of the geographic region does not agree with the
resolution of the raster map layer, unintended resampling of the original
data may occur. The user should be sure that the geographic region
is set properly.
## SEE ALSO

*g.region*,
*r.clump*,
*r.neighbors*
## AUTHOR

Michael Shapiro,
U.S.Army Construction Engineering Research Laboratory
*Last changed: $Date: 2003/05/06 14:04:17 $*

Main index - raster index - Full index