[GRASS-user] Re: r.mapcalc changes color table

Tim Michelsen timmichelsen at gmx-topmail.de
Fri Nov 27 04:58:32 EST 2009


First,
thanks to all who responded. I will try and apply that later.

>>> 6) use r.mapcalc to cut: r.mapcalc "cut=if(boundary_raster, large_map,
>>> null())"
>>
>> Replace step 6 with:
>>
>>     g.copy rast=boundary_raster,MASK
>>     r.resample input=large_map output=cut
>>     g.remove rast=MASK
>>
> 
> Can someone perhaps explain why steps 4 and 5 are necessary?
> (My understanding is that r.mapcalc anyway observes the region settings)
> 
> 
> Couldn't step 6 be simplified to:  r.mapcalc cut = large_map
> ?
I don't know. That was the approach I have always seen and been told.

The question is:
when do I use r.resample and when do I use r.mapcalc to cut a smaller
portion from a large raster map?

from the man page:
The method by which resampling is conducted is "nearest neighbor" (see
r.neighbors). The resulting raster map layer will have the same
resolution as the resolution of the current geographic region (set using
g.region).

I actually do not want to extract by sampling than rather copy a smaller
area from the large map.

It would be nice to receive a best practice confirmation on this by a
GRASS power user.

Is there a "best practice page" in the wiki where this could be added?

Thanks in advance,
Timmie



More information about the grass-user mailing list