[GRASS-user] r.resamp.stats: how to count valid input pixels

Glynn Clements glynn at gclements.plus.com
Thu Aug 14 04:01:30 PDT 2014


peifer wrote:

> I am trying to find a way to do "r.resamp.stats method=average" together
> with some option like: "propagate NULLs, but only if >= 50% of the input
> pixels are NULLs".
> 
> I was hoping that some "method=countvalid" would perhaps exist, that would
> generate a map which I could use to MASK unwanted/unreliable aggregation
> results. But it doesn't.
> 
> Any suggestions?

Create a validity map with e.g.

	r.mapcalc "valid = !isnull(input)"

then use r.resamp.stats method=average on that.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list