How Focal Flow works

While the Focal Flow tool uses a "moving window" approach to process through a dataset in a similar manner as the Focal Statistics tool, how the output values are calculated is not the same. The tool uses the immediate 3 x 3 neighborhood to determine which of a cell's eight neighbors flows into it. Flow is defined by any cell within the neighborhood that has a higher value than the processing cell. Many times the values represent fluid movement, such as water moving across an elevation or slope surface, but flow can be any movement you define, such as the way contaminants move to a location of lower concentration.

To test whether a particular neighborhood cell will flow into the processing cell, the value of each neighborhood cell is subtracted from the processing cell. If a value is positive, the neighborhood cell does not flow into the processing cell; if it is negative, it does. If no cells flow into the processing cell, the location will receive a value of 0. If a threshold value has been entered, the difference between the value of the neighborhood cell minus the value of the processing cell must be greater than the threshold for flow to occur. If it is not, there is no flow from the neighborhood cell.

The management of the combination of flow from multiple neighborhood cells into a single processing cell is accomplished through the binary representation of the processing cell. Each bit of the binary representation for the processing cell correlates to a neighborhood cell location. The cell to the immediate right of the processing cell is given the value 1, the neighbor to the lower right is 2, the neighbor directly below is 4, and so forth—until the value of 128 (powers of two, since representation occurs in binary) is reached for the last neighbor to the upper right.

Focal Flow direction encoding
Focal Flow direction encoding

If a neighborhood cell flows into the processing cell, the bit that represents the neighborhood location (see preceding diagram) is turned on, or assigned a 1. If a neighborhood cell does not flow into the processing cell, the bit that represents the location is turned off, or assigned value 0. Once all neighborhood locations have been tested for flow, none, one, several, or all bits can be turned on (assigned a 1). The binary representation for all bits is converted back to base10 in accordance with the flow-bit pattern. The base10 number is then assigned to the processing cell. The encoding assigns a unique number to each possible combination of upstream numbers. The total number of combinations of flow into a processing cell is 255.


Some examples demonstrating how the output value is derived follow:

Related Topics