Let w be a moving window filter of dimensions 5×5 cells (500 x 500 metres here).
w <- matrix(c(0,0,50,0,0,0,50,50,50,0,50,50,500,50,50,0,50,50,50,0,0,0,50,0,0), nr=5,nc=5)
[,1] [,2] [,3] [,4] [,5]
[1,] 0 0 50 0 0
[2,] 0 50 50 50 0
[3,] 50 50 500 50 50
[4,] 0 50 50 50 0
[5,] 0 0 50 0 0
n <- focal(lu56, w=w)
This command generates a neighbourhood transition potential map from lu56. Have a look at this useful webpage:
But it has the unwanted side effect of increasing the width of the nodata areas, thus massively increasing the size of the feature land use classes and the zoned area. We seriously don’t want this. BUT, luckily, its easily fixed:
nhood <- cover(n, lu56)
The cover operation (see Raster package manual) fills the null values in the first map with the values in the second, so now we have a final neighbourhood potential map for the transition period 1956-57
model_nhood <- nhood #rename to model_nhood so we know this is our final neighboorhood potential map.
Full details on setting the neighbourhood effect using the Automatic Rule Detection (ARD) procedure in SIMLANDER are described by Majid Shadman here
Download our paper on this from here