<div dir="ltr">Hi,<div><br></div><div>I'd like to calculate the sum of all raster values that belong to a certain group. This spatially organized group is also indicated by an overlay raster (same resolution). Finally I want to assign these sums to a new raster. That might sound slightly complicated but here an example:</div>
<div><br></div><div>Asume following initial raster map A with random values like:</div><div><br></div><div>1-2-1-1-3-4-3-4-2-5-2-3</div><div><br></div><div>and an overlay raster indicating 3 groups:</div><div><br></div><div>
1-1-1-1-2-2-2-2-3-3-3-3</div><div><br></div><div>the sums for the groups are:</div><div>group 1 = 5</div><div>group 2 = 14</div><div>group 3= 12</div><div><br></div><div>so the final raster would be:</div><div><br></div><div>
5-5-5-5-14-14-14-14-12-12-12-12</div><div><br></div><div>How can such a task be achieved in GRASS (7)?</div><div>Any ideas?</div><div><br></div><div>/Johannes</div></div>