NetLogo 7.0.0-beta2:

gis:convolve

gis:convolve RasterDataset kernel-rows kernel-columns kernel key-column key-row

Reports a new raster whose data consists of the given raster convolved with the given kernel.

A convolution is a mathematical operation that computes each output cell by multiplying elements of a kernel with the cell values surrounding a particular source cell. A kernel is a matrix of values, with one particular value defined as the “key element”, the value that is centered over the source cell corresponding to the destination cell whose value is being computed.

The values of the kernel matrix are given as a list, which enumerates the elements of the matrix from left to right, top to bottom. So the elements of a 3-by-3 matrix would be listed in the following order:

1 2 3
4 5 6
7 8 9

The key element is specified by column and row within the matrix. Columns are numbered from left to right, beginning with zero. Rows are numbered from top to bottom, also beginning with zero. So, for example, the kernel for the horizontal Sobel operator, which looks like this:

1 0 -1
2 0
(key)
-2
1 0 -1

would be specified as follows:

let horizontal-gradient gis:convolve dataset 3 3 [1 0 -1 2 0 -2 1 0 -1] 1 1

Take me to the full GIS Extension Dictionary