[GRASS-user] cutting rasters with a vector

Nikos Alexandris nik at nikosalexandris.net
Sat Nov 30 02:07:14 PST 2013


Francesco Pirotti UNIPD wrote:

> Just a shot: rasterize a vector polygon and use the rasterized area (or
> areas) as mask?

I wouldn't think otherwise too. In GRASS GIS 6.4.x you have to go this path 
along (v.to.rast, r.mask, r.mapcalc).  In GRASS GIS 7, however, you can mask 
from a vector directly (i.e. r.mask vector=SomeVectorMap).

Ensure to have set the resolution of the region to the one you desire as an 
output. Most of the times it should match the resolution of the raster map(s) 
to be masked. Otherwise, a resampling (based on Nearest Neighbour) will take 
place.

Nikos


More information about the grass-user mailing list