[GIS] way to find out which pixel values are around the current pixel

arcgis-desktoparcpypythonraster

I would like to write a cycle which takes a current pixel, look at the surrounding pixels, choose the pixel with max/min value and skip to that pixel…and so on.

Is there in arcpy such a function which can work with pixel's neighborhood?

Best Answer

What about using Get Cell Value with offsets equal to the cell size as location_point? E.g. if the coordinates of the center of your pixel of interest are (x, y) and the cell size of your raster is 10, you run the tool for (x - 10, y), (x + 10, y), (x, y - 10) and so on, add every result to a list and select the min or max value from the list.