I want to do the following: I have a set of cells with the value 1, and a set of values with 2. I want to calculate for each cell [2] the distance - ideally number of cells - to the nearest cell 1. Can I somehow do this in GRASS GIS?

enter image description here


Found the solution: use r.grow.distance. Use a raster with [1] as value and the area of [2] as "no data". The resulting raster shows the distance of cells in the [2] are to the nearest cell [1], as manhattan, euclidean, maximum, etc.

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.