Hermann Peifer 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)
I wasn't paying attention. For a rectangular area, you can just change the region then make a copy with r.resample or r.mapcalc. I was assuming an arbitrary (not necessarily rectangular) region. For a rectangular region, steps 3 through 6 can be replaced with a single call to r.resample. > Couldn't step 6 be simplified to: r.mapcalc cut = large_map > ? Which is equivalent to "r.resample in=large_map out=cut". Using r.resample is probably more convenient from the GUI, as you can select the input from a list. -- Glynn Clements <gl...@gclements.plus.com> _______________________________________________ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user