I want to find the closest point of water to each forest pixel, and the difference in elevation, to see how deep should a channel be dug in order to get water to the mangrove.
My aim is to obtain a raster with the values of the subtraction between a layer and its closest point in another elevation layer
I want to keep it raster (finding closest distance between polygons may take hours, while it needs just a couple of minutes in raster). It can be in GRASS, R, QGIS or python. I've been trying with r.distance and library(raster) without success. It may be a 3d distance I guess.