[GRASSLIST:24] Raster cutting

Hello!

I am quitre new user of GRASS and my question may look prosaic.

Is it possible using GRASS to cut out demanded shape of raster difined by polygon geometry?
I am looking for tool like v.cutter but for raster layer. For example I have a DEM or scaned maps and I would like to cut out area coresponding to my province from that.

Thanks in advance for any help and suggestion.

Best regards,

Robert Siudak

On Thu, 15 May 2003 Robert.Siudak@imgw.pl wrote:

Hello!

I am quitre new user of GRASS and my question may look prosaic.

Is it possible using GRASS to cut out demanded shape of raster difined
by polygon geometry? I am looking for tool like v.cutter but for raster
layer. For example I have a DEM or scaned maps and I would like to cut
out area coresponding to my province from that.

Using the spearfish example dataset, I did:

g.list vect

to choose a suitable vector map

v.info quads
d.mon start=x0
d.vect quads
d.what.vect

and verified that there are just two areas (and some missing data)

v.to.rast input=quads output=quads12
r.support -r map=quads12
r.info quads12

still two categories, then

r.mask

which has to be run interactively, to set the region(s) you want to see to
1, the others to 0. This creates a raster called MASK, which will restrict
raster display to the cells valued 1 in the MASK

d.rast geology

Of course, this depends on the input vector areas being well-defined, and
having appropriate category values.

Hope this helps!

Roger

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no

Is it possible using GRASS to cut out demanded shape of raster difined
by polygon geometry? I am looking for tool like v.cutter but for
raster layer.

If you have a *labeled* vector area already, just use v.to.rast then
r.mapcalc. Easy.
v.line2area, v.digit, and v.llabel might help you along.

If you just have coordinates, try r.in.poly with r.mask or r.mapcalc.
I use this all the time, works great. v.in.ascii can be useful too.

Read the r.in.poly, v.in.ascii, and r.mapcalc man pages anyway.

g'luck,
Hamish