I have a raster with cells that have a value of either 0 or 1. What I would like to do is create a new raster that shows the distance of each cell to the nearest cell with a value of 1.
For all cells with value 1, this distance would then obviously return '0'. For all cells with value 0, it would give me the distance to the nearest cell with value '1'.
I have been playing around with the Euclidean distance function in Arcmap but I feel like an extra step is required? The output currently just gives '0' distance for all cells that have a value in the input raster (0 or 1).
I am comfortable doing this in both Arcmap or R.
EDIT- SOLUTION FOUND: Change the raster to a points shapefile, it will create a column with values 0/1. Then delete the 0 values. Then create a euclidean distance raster to what remains of this shapefile, and clip as desired. this works although it seems a little convoluted!