Fill depressions

This tool can be used to fill all of the depressions in a digital elevation model (DEM) and to remove the flat areas. This is a common pre-processing step required by many flow-path analysis tools to ensure continuous flow from each grid cell to an outlet located along the grid edge. The Fill Depressions algorithm is based on the computationally efficient approach of examining each cell based on its spill elevation, starting from the edge cells, and visiting cells from lowest order using a priority queue. As such, it is based on the algorithm proposed by Wang and Liu (2006). It is currently the most efficient depression-removal algorithm available in Whitebox GIS for use with small to medium sized DEMs. The efficiency of the algorithm is severely diminished if the data cannot be held entirely in memory and in the worst case, the tool may throw a memory overflow error. In this event, it is better to use the depression filling algorithm that is based on the Planchon and Darboux (2001) algorithm.

If the input DEM has gaps, or missing-data holes, that contain NoData values, it is better to use the Fill Missing Data Holes tool to repair these gaps. This tool will interpolate values across the gaps and produce a more natural-looking surface than the flat areas that are produced by depression filling. Importantly, the Fill Depressions tool algorithm implementation assumes that there are no 'donut hole' NoData gaps within the area of valid data. Any NoData areas along the edge of the grid will simply be ignored and will remain NoData areas in the output image.

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 + "output.dep"
flatIncrement = "0.001"
args = [DEMFile, outputFile, flatIncrement]
pluginHost.runPlugin("FillDepressions", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
def DEMFile = wd + "DEM.dep"
def outputFile = wd + "output.dep"
def flatIncrement = "0.001"
String[] args = [DEMFile, outputFile, flatIncrement]
pluginHost.runPlugin("FillDepressions", args, false)

Credits: