[GRASS-user] Re: r.mapcalc changes color table
Hermann Peifer
peifer at gmx.eu
Fri Nov 27 03:03:20 EST 2009
Glynn Clements wrote:
> Tim Michelsen wrote:
>
>> I have a large georeferenced digital map.
>>
>> I successfully imported it into GRASS.
>>
>> Now I would like to "cut" only a small rectangle -- my investigation
>> area -- out of this large map.
>>
>> I used the following approach:
>>
>> 1) import the TIFF
>> 2) select the part of interest in the GRASS monitor
>> 3) set the zoomed area as region (monitor tools)
>> 4) create a boundary vector: v.in.region
>> 5) convert boundary raster to a raster v.to.rast
>> 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
?
Hermann
More information about the grass-user
mailing list