[GRASSLIST:25] Re: Raster cutting

Roger Bivand Roger.Bivand at nhh.no
Thu May 15 03:35:11 EDT 2003


On Thu, 15 May 2003 Robert.Siudak at 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 at nhh.no




More information about the grass-user mailing list