The Neighborhood Statistics function

The Neighborhood Statistics function helps you discover trends within a single raster dataset based on the values within a specified group of cells, which surround and usually include the evaluation cell. This technique is like passing a filter over your data and can be used to indicate diversity of feature types or to impose neighboring values over existing values.

With a 3-cell by 3-cell neighborhood, the evaluation cell is located in the center of the neighborhood.

Statistics are determined based on the cells in the neighborhood. The corresponding cell in the output raster is given the resulting statistical value. The neighborhood passes over every cell of the input raster, left to right, top to bottom, until all of the cells have been processed.

You determine the size and shape of the neighborhood. For example, you can use a rectangular neighborhood of any dimension.

If an even number is used in the x-direction of a rectangular neighborhood, the center cell will be to the left of the true neighborhood center. If an even number is used in the y-direction, the center cell will be above the true center of the neighborhood

Alternatively, you can use other neighborhood shapes, such as a circle, an annulus (a doughnut shape), or a wedge.

This graphic illustrates the processes involved in specifying any of the three types of circular neighborhoods.

A circular neighborhood is specified by giving the radius of the circle in the number of cells measured perpendicular from the x- or y-axis.

The annulus or donut neighborhood requires two radii. The first specifies the number of cells to the inside of the donut and the second, the number of cells to the outer edge. Only cells that fall between the two radii will be considered.

The wedge or partial circle is specified by identifying the radius of the circle and two-degree bearings that define the slice of the circle for the neighborhood. The smaller degree reading must be specified first, and only the cells between the two degree readings will be considered when processing each cell. Zero degrees is to the east and 90 degrees is to the north; the bearing increases counterclockwise.

If you don’t specify a neighborhood shape or size, Spatial Analyst uses the default, a 3-cell by 3-cell rectangular neighborhood.