[GRASS-user] Clipping rasters

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Tue Aug 10 11:57:48 EDT 2010


Hanlie Pretorius wrote:
...

Nikos A:
> > #first, check and set your region of interest
> > g.region vect=border -pa

> Tried this with the same result, as Jarek points out in the second
> reply. So, I assume it's impossible to have a raster with an irregular
> boundary in GRASS?

(
I don't think so. GRASS raster engine is eXtremely powerfull. You can even 
sketch circles if you'd like using r.mapcalc
)

> >> # convert vector border to raster
> >> v.to.rast input="border" output="border" use="cat" type="area" layer=1
> >> value=1 rows=4096                                |
> >> 
> >> # set the mask to the raster border
> >> r.mask border

#replace the above and use r.mapcalc instead:
r.mapcalc MASK=border

> >> # create the clipped DEM
> >> r.mapcalc

> >> >dem_clipped=dem_full
> >> 
> >> # remove the mask
> >> r.mask -r
> >> -----

Nikos


More information about the grass-user mailing list