[R-sig-Geo] Identify specific pixel neighbours

Paulo Flores Ribeiro p@u|o@||ore@@m@|| @end|ng |rom gm@||@com
Tue Nov 9 18:39:49 CET 2021


I would like to create a raster from an existing one, where each pixel 
in the new raster is set to 1 if the corresponding pixel in the existing 
map is in the direct neighbourhood (8 neighbouring pixels) of at least 1 
pixel with a particular value, or 0 if otherwise (e.g., create a raster 
that identifies all "agricultural" pixels that are neighbours of "urban" 
pixels). How to do this in the most computationally efficient way?
Thanks in advance, PauloFR



More information about the R-sig-Geo mailing list