Calculating statistics for overlapping and non-overlapping neighborhoods

The neighborhood operations calculate output values by calculating a specified statistic to all the input cells that are contained in each neighborhood. The neighborhood is a moving window that iterates through the input data.

There are two basic kinds of neighborhood operations in Spatial Analyst: the operations where the neighborhoods of the processing locations overlap and those where the neighborhoods do not overlap.

The Focal Statistics tool processes the input dataset with overlapping neighborhoods. The Block Statistics tool processes data with neighborhoods that do not overlap.

Comparing Block vs. Focal neighborhoods

In the focal operation, only the processing cells receive the result of the calculation of all the cells in the neighborhood, whereas in the block operation, every cell within the minimum bounding rectangle that contains the neighborhood receives the same output value.

Neighborhood shape

The defined neighborhood shapes that can be specified are a rectangle of any dimension, a circle of any radius, an annulus (a doughnut shape) of any radius, and a wedge in any direction.

Neighborhood shapes

In addition to these geometric shapes, you can also create an irregularly shaped neighborhood, often called a kernel, where you can control exactly which cells in the neighborhood will be included in the calculations. Further, you can also apply different weights to specific cells in the neighborhood.

Example irregular and weighted kernel neighborhoods

Cells in the input raster that fall within the specified neighborhood will be included in the calculations being performed for that neighborhood.

The following lists some details about the different neighborhood shapes:

Types of neighborhood statistics

Various statistics can be computed on the cell values within the neighborhood being processed:




Determines the value that occurs most often in the neighborhood


Determines the maximum value in the neighborhood


Computes the mean of the values in the neighborhood


Computes the median of the values in the neighborhood


Determines the minimum value in the neighborhood


Determines the value that occurs least often in the neighborhood


Determines the range of values in the neighborhood

Standard deviation

Computes the standard deviation of the values in the neighborhood


Computes the sum of the values in the neighborhood


Determines the number of unique values in the neighborhood

Neighborhood statistics

Related Topics