I would like to sum the values of a grid, moving upstream along flow paths. In other words, I have a grid A with a value for each cell. I need to build a new grid, B, in which the value of each cell should be the sum of the A values of all the cells located downstream along the flow path.

How this can be done in a GIS software (better if QGIS, SAGA or GRASS) or R?

  • what do you mean with flow path? the cell i = 1, j = 1 in grid B is the sum of all the cells in grid A? – Guzmán Dec 5 '16 at 21:29

r.watershed allows you to specify the "flow" for each cell. So, r.watershed elev=DEM flow=A accumulation=B might work, but it isn't clear from your question if this is what you want. In this scenario, B is the accumulated value of all upstream cells. If this is not what you want, then r.watershed is probably still a good first step, and the output from that can be used with r.stream.channel or other hydrology modules.

See https://grass.osgeo.org/grass73/manuals/r.watershed.html

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.