[GRASS-user] Do filters available in GRASS takes care of cell padding?

Glynn Clements glynn at gclements.plus.com
Mon Nov 30 18:11:01 PST 2015

Uttam Kumar wrote:

> Do the filters available in GRASS GIS such as average, low pass, high pass
> filters take care of cell padding automatically?


> By Cell paddding, I refer to duplicating the first row on top, duplicating
> bottom row at the bottom, duplicating first column before the actual first
> column and duplicating last column after the actual last column.

None of the modules do this, although you can achieve that result by
by first using e.g. r.grow.distance with the value= option to replace
null cells with the nearest non-null cell.

r.resamp.filter simply enlarges the source region by the kernel
radius. If this results in it reading nulls (because the enlarged
region extends beyond the area for which the map contains data), then

a) the nulls will be propagated (if -n is used) or,

b) the weighting will be adjusted, i.e. the result will be

	sum(weight * value)/sum(weight)

where both sums are evaluated over the non-null inputs.

r.resamp.stats behaves similarly (i.e. it either propagates nulls or
computes the aggregate over the non-null cells).

r.neighbors always calculates the aggregate over the non-null cells.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-user mailing list