On 12/06/2012 10:18, Antonello Lobianco wrote:
Hello everybody on the list!

  I am a "occasional" grass gis user and I'm stuck with a relatively simple task: I have a high-res vector layer describing only one category (Corine Land Cover map for "broad-leaved forests", 311) and I want to rasterise it in a low-res 8-by-8 km raster map where the value stored on each cell is the area (or, that's the same, the share of the area) that the vector cover within that cell.
So each pixel/cell would have a value ranging from 0 (no broad-leaved forest at all) to 64 (all the area of the pixel is covered by broaded-leaved forests).
I already managed to get the region with the right cell dimension, add the area geometry to the vector and load it in grass, but I don't know now how to rasterize it (v.to.raster seems to me to not offer the option to put the area, but only a specific catgegory, but maybe I am wrong??).


I'm not sure what your final goal is, but you can do what you've described as follows:

# First set resolution to 1 km
g.region -p res=1000
# Now rasterize the vector
v.to.rast broad_leaf_vector out=broad_leaf_1km type=area use=val val=1 
# THis will give you as raster of 1km X 1km with values of 1 where the original vector covered, and null otherwise
# Now change resolution to 8km and use r.resamp.stats to resample to your courser region:
g.region -p res=8000
# Use the "sum" method of r.resamp.stats to get the values for the new, coarse raster
r.resamp.stats broad_leaf_1km out=broad_leaf_8km method=sum
# Should leave you with a new raster of res 8km, and with values 0-64

HTH,
Micha

Thank you for any hint you could provide me.

Antonello


--
Antonello Lobianco
INRA, Laboratoire d'Economie Forestière
14 Rue Girardet - 54000 Nancy, France
Tel: +33.652392310
Email: [email protected]
http://antonello.lobianco.org

This mail was received via Mail-SeCure System.


_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.




-- 
Micha Silver
052-3665918
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to