[GRASS-user] Intersection of Vector polygons with raster

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Mon Sep 15 12:35:51 EDT 2008


On Sun, 2008-09-14 at 14:22 -0700, Brock Anderson wrote:
> Hello,
> 
> I have two raster layers that I want to run r.stats on.  I also have  
> a vector layer with polygons, and I'm only interested in applying  
> r.stats to the raster cells that fall within the vector polygons.
> 
> It looks like r.stats can't clip to the vector itself.  Is there any  
> command that will help me pro-process my rasters by clipping them  
> against the polygons?
> 
> Thanks,
> Brock

Hi Brock!

(a) Rasterise the vector polygons and assign cat values (one unique
value) to each raster area, then loop over each raster area the r.stats
module (using the cat value! and export result of each loop in a file)

(b) use starspan (much simpler!)
http://starspan.casil.ucdavis.edu/doku/doku.php?id=start

Cheers, Nikos



More information about the grass-user mailing list