QGIS newbie here. I have a DTM raster layer and a river raster layer that shows location of rivers. I would like to first check if cell X is a river. If yes, check if any of its 8 neighbouring cells is also a river. If yes, check if the difference in elevation between cell X and any of those neighbouring cells that are a river is > 10 m. Assign 1 if true, 0 if false.
The closest Q&A I found was Cell calculations; QGIS,GRASS,GDAL,SAGA, but I don't believe that answers my question.
Using ChatGPT I was able identify which river cells have a > 10 m elevation difference with any of their neighbouring cells (using r.neighbors
). What I need now is to turn true only if any of those neighbouring cells are a river.