jeudi 26 février 2015

How to get cell value along Flow Direction


I have:



  • a flow direction raster where I took off (assigned NoData value) the cells that overlayed the river network (from flow accumulation).

  • a perfectly overlapping raster where I asigned a coefficient value to the cells (except the ones overlapping the river network)


I need to calculate an index for every cell of my raster that is calculated as the mean between the coefficient value of the cell and those of all the cells between the first and the river network, along the flow direction.


To explain better: Let's begin with a cell, who has its coefficient value (c1) and has a 8 in the flow direction raster. I want to pick the coefficient value and "move" to the south-west cell (that is the next one along the flow direction). Then I want to pick its coefficient value (c2), see in the FlowDirection raster which is the next cell and move there, to pick its coefficient value (c3)....and so on till I find a cell with NoValue (river network).


Then I need to calculate the mean beetween these values and assign the result, in a new raster, to the beginning cell


(c1+c2+....cn)/n





Aucun commentaire:

Enregistrer un commentaire