## Raster Flow Direction

### Summary

The tool use D8 algorithm to calculate the raster of flow direction for each pixel.

D8 algorithm is to build flow direction from each pixel to downhill neighbouring pixel of the most steep angle.The output of pixel value is within 1-255 of Integer format.

Note:
1.If the pixel Z value is the lowest among the eight neighbouring pixels, it will be assigned to the minimum value among its neighbourings. And flow direction is to this pixel. If multiple neighbouring pixels have the same lowest value, it will still be assigned to the minimum value among its neighbourings.But its flow direction will be definded via one of the following method. This can filter abnormal low noisy point.

2.If the z-value of a pixel changes the same in multiple directions, and the pixel is part of a sunken point, the flow direction of the pixel will be considered undefined. At this time, the value of the pixel in the output flow direction raster will be the sum of these directions. For example, if the z-value changes the same to the right (flow direction = 1) and downward (flow direction = 4), the flow direction of the cell is 1 + 4 = 5. You can use the sink tool to mark pixels with undefined flow directions as sunken points.

3.If the z-value of a pixel changes the same in multiple directions, and the pixel is not part of a depression, a lookup table that defines the most probable direction will be used to specify the flow direction. See Greenlee (1987).

4.The output D8 descent rate raster data will be calculated based on the z-value change rate of the path length between the pixel centers and expressed as a percentage. For adjacent pixels, this is similar to the percentage slope between pixels. When crossing a flat area, the distance becomes the distance to the nearest pixel with a lower elevation. The result is a graph of the percentage increase in elevation in the steepest descent path from each pixel.

5.When calculating the D8 descent rate raster data of a flat area, in order to improve performance, the distance to the diagonally adjacent pixel (1.41421 cell size) is approximately calculated as 1.5 cell size.

### Description

The key to obtaining the hydrological characteristics of the surface is to determine the flow direction from each pixel in the grid. This can be done with the flow direction tool.

The tool takes the surface as input and outputs a raster showing the direction of flow from each pixel. If the output rate of decline raster data option is selected, an output raster expressed as a percentage will be created, showing the maximum rate of change in elevation from each pixel along the flow direction to the length of the path between the pixel center. If the Force all edge cells to flow outward is selected, all cells at the edges of the surface raster will flow outward from the surface raster.

The flow direction is determined by the steepest descent direction or the maximum descent direction from each pixel. The flow direction is calculated as follows:

``````maximum_drop = change_in_z-value / distance * 100
``````

Calculate the distance between the centers of the pixels.

1.If the pixel size is 1, the distance between two orthogonal pixels is 1, and the distance between two diagonal pixels is 1.414 (the square root of 2). If multiple pixels have the same maximum descending direction, the range of adjacent pixels will be expanded until the steepest descending direction is found. After finding the direction of the steepest descent, the output pixel will be encoded with a value representing that direction.

2.If all neighboring pixels are higher than the pixel to be processed, the pixel to be processed will be regarded as noise and filled with the lowest value of its neighboring pixels. The pixel to be processed has a flow direction towards itself. However, if the single pixel sink point is located near the actual edge of the grid or has at least one NoData pixel as an adjacent pixel, it cannot be filled due to insufficient neighborhood information. To treat a pixel as a real single-pixel sink, all neighborhood information must exist.

3.If two pixels flow into each other, they are both meeting points and have an undefined flow direction. This method of obtaining flow direction through a digital elevation model (DEM) was introduced by Jenson and Domingue (1988).

### Usage

Click Geological Analysis >Raster Flow Direction. ### Parameters

• Input File：Select input tiff file.

• Output Path：Select output path.

``````  @inproceedings{
author={Sch\"{o}Greenlee, D. D.},
title={Raster and Vector Processing for Scanned Linework},
booktitle={Photogrammetric Engineering and Remote Sensing },
year={1987},
}

@inproceedings{
author={Sch\"{o}Qin, C., Zhu, A. X., Pei, T., Li, B., Zhou, C., & Yang, L},
title={An adaptive approach to selecting a flow partition exponent for a multiple flow direction algorithm},
booktitle={International Journal of Geographical Information Science},
year={2007},
}
``````