Thank you Moritz, your suggestion using r.stats and the rasterized layer 2 of buffers works really nice. It took me just a while to summarize and join all data and get them back into the db in the right format. However, I think I managed this task now. Thank you for your help!
I also think that either a correpondance table function and/or an enhancement of v.rast.stat to work with overlapping buffers would be a really nice enhancement. On Thu, Jun 1, 2017 at 5:00 PM, Moritz Lennert <[email protected] > wrote: > On 01/06/17 16:41, Moritz Lennert wrote: > >> Currently, the best way I see is to create a correspondance table >> between the pieces and the original cat values. You can get that by >> running >> >> v.category buffers op=add layer=2 out=buffers_2_layers >> > > [...] > > Then just run v.rast.stats once per class (each class raster can just be >> a reclass of the original with classnum = 1\n* = NULL") on layer 2 of >> the entire vector buffer map. Thus you will get the stats per piece of >> buffer. >> > > Instead of looping over the classes, you could also rasterize the layer 2 > of buffers with v.to.rast [...] use=cat and then run r.stats on the two > layers: > > r.stats -c buffers,landuse > > Add the results as another temporary table to the db and use it plus the > correspondance table to fill your original table. > > Moritz > >
_______________________________________________ grass-user mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/grass-user
