D8 flow pointer (direction)

This tool is used to generate a flow pointer grid using the simple D8 (O'Callaghan and Mark, 1984) algorithm. The user must specify the name of a digital elevation model (DEM) that has been hydrologically corrected to remove all spurious depressions and flat areas. DEM pre-processing is usually achived using the Fill Depressions tool.

In Whitebox GAT, D8 flow pointers use the following clockwise, base-2 numeric naming convention:

Flow directions

Thus, a grid cell that flows to the northwest will be assigned a '64' in the D8 flow pointer raster. Notice that grid cells that have no lower neighbours are assigned a flow direction of zero. In a DEM that has been pre-processed to remove all depressions and flat areas, this condition will only occur along the edges of the grid.

Grid cells possessing the NoData value in the input DEM are assigned the NoData value in the output image. The output raster is of the integer data type and categorical data scale.

See Also:

Scripting:

The following is an example of a Python script that uses this tool:

wd = pluginHost.getWorkingDirectory()
demFile = wd + "DEM.dep"
outputFile = wd + "pointer.dep"
args = [demFile, outputFile]
pluginHost.runPlugin("FlowPointerD8", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
def demFile = wd + "DEM.dep"
def outputFile = wd + "pointer.dep"
String[] args = [demFile, outputFile]
pluginHost.runPlugin("FlowPointerD8", args, false)

Credits: