Modified R Code from raster package raster::getValuesFocal. Returns one row per pixel, which contains the values of the pixel neighborhood that is defined by the size of the window. The size of the window is defined by the window side length (wsl). The window is centered on one specific pixel.
getValuesWindow(x, wsl, padValue, aroundTheGlobe, ...)Returns a matrix. The matrix contains the values of the defined window centered on the respective pixel.
raster layer. The input raster layer.
integer. The window side length. The window is defined by wsl x wsl.
atomic. If a pixel is on the edge of an image, padding should be used? Can be NA or a value.
logical. Does the image go around the globe?
possible further arguments.