I have two raster layers that are equal extent and resolution: one that is qualified as nonforest tree cover that is made up of pixels with either the value of 1 or NA, and one DEM. enter image description here

What I am hoping to do is to essentially create a varying buffer around each pixel of value 1 in the nonforest tree cover raster layer that includes +200 and -200 meters of elevation.

I imagine this would have to be accomplished by going through each pixel where the value is 1 (non-NA) and progressively testing each adjacent pixel to see if it falls within 200 meters of the original pixel elevation and continuing from each within range pixel until the desired elevation range is exceeded, however I am unsure of how best to do this. My desired outcome is a raster layer where all of the relevant pixels share one value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.