[GRASSLIST:5583] Re: raster mask color

David Orme d.orme at imperial.ac.uk
Tue Feb 1 04:11:08 EST 2005


Hi,

Thanks for the help, Hamish. I'd forgotten that masking isn't just 
about display masking - when you d.rast somefile with a MASK raster 
present then what you actually see is something like:

r.mapcalc 'display=if(MASK, somefile, null())'

Is that about right? I think I was hoping that it implicitly did 
something more like 'd.rast somefile; d.rast -o MASK' so you could 
independently set mask colour but of course the masking applies to 
raster calculations as well as just raster display. I should be using 
d.rast -o rather than setting a MASK:

r.mapcalc 'overlay5=if(total_richness_270105<=5,1,null())'
echo -e "1 60:60:60\nend" | r.colors overlay5 col=rules
d.rast -o overlay5

Cheers,
David


On 31 Jan 2005, at 20:47, Hamish wrote:

>> Can someone tell me how to set the mask color in Grass 6 beta 1? I've
>> created a mask using r.mapcalc and I've tried using r.colors to set
>> the  mask colour but I can't get the mask to be anything other than
>> white.
>
>
> from the r.colors help page:
>
> [r.colors color=rules ...]
> To set the NULL (no data) color, use the "nv" parameter:
>
> 0 black
> 10% yellow
> nv white
> end
>
>
>
>
> so make a rule, e.g. "nv 60:60:60" to make all NULL areas a dark grey.
>
>
>
> Hamish
>




More information about the grass-user mailing list