[GRASS-dev] dealing with null values in rasters only within mask

Moritz Lennert mlennert at club.worldonline.be
Fri Jun 28 02:56:19 PDT 2019


On 28/06/19 11:10, Stefan Blumentrath wrote:
> Hi Moritz,
> 
> Did you consider r.stats -N for checking for NULL values within the masked area, like:
> r.stats -N input=tile,MASK
> if there is *|1 in the output you have NULL cells in the tile...

Nice trick, didn't actually know about the -N flag...

> 
> For filling NULLs with a given value you could do:
> r.mapcalc expression=tile_filled=if(MASK,if(isnull(tile),1,tile),null())

Duh, now that I see this, it seems quite obvious.

Thanks Stefan !

(And thanks Ken for your ideas)

Moritz



More information about the grass-dev mailing list