Skip to content

r.hydrodem

Hydrological conditioning, sink removal

r.hydrodem [-afc] input=name [depression=name] [memory=integer] output=name mod=integer size=integer [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.hydrodem input=name output=name mod=4 size=4

grass.script.run_command("r.hydrodem", input, depression=None, memory=300, output, mod=4, size=4, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.hydrodem", input="name", output="name", mod=4, size=4)

Parameters

input=name [required]
    Elevation map
    Elevation map to be hydrologically corrected
depression=name
    Depression map
    Map indicating real depressions that must not be modified
memory=integer
    Maximum memory to be used in MB
    Default: 300
output=name [required]
    Name of hydrologically conditioned raster map
mod=integer [required]
    Only remove sinks requiring not more than <mod> cell modifications.
    Default: 4
size=integer [required]
    Only remove sinks not larger than <size> cells.
    Default: 4
-a
    Remove all sinks.
    By default only minor corrections are done to the DEM and the result will not be 100% hydrologically correct.Use this flag to override default.
-f
    Fill sinks.
    By default a least impact approach is used to modify the DEM.Use this flag to force filling of sinks.
-c
    Carve out of sinks.
    By default a least impact approach is used to modify the DEM.Use this flag to force carving out of sinks.
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str, required
    Elevation map
    Elevation map to be hydrologically corrected
    Used as: input, raster, name
depression : str, optional
    Depression map
    Map indicating real depressions that must not be modified
    Used as: input, raster, name
memory : int, optional
    Maximum memory to be used in MB
    Default: 300
output : str, required
    Name of hydrologically conditioned raster map
    Used as: output, raster, name
mod : int, required
    Only remove sinks requiring not more than <mod> cell modifications.
    Default: 4
size : int, required
    Only remove sinks not larger than <size> cells.
    Default: 4
flags : str, optional
    Allowed values: a, f, c
    a
        Remove all sinks.
        By default only minor corrections are done to the DEM and the result will not be 100% hydrologically correct.Use this flag to override default.
    f
        Fill sinks.
        By default a least impact approach is used to modify the DEM.Use this flag to force filling of sinks.
    c
        Carve out of sinks.
        By default a least impact approach is used to modify the DEM.Use this flag to force carving out of sinks.
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

r.hydrodem applies hydrological conditioning (sink removal) to a required input elevation map. If the conditioned elevation map is going to be used as input elevation for r.watershed, only small sinks should be removed and the amount of modifications restricted with the mod option. For other modules such as r.terraflow or third-party software, full sink removal is recommended.

OPTIONS

  • input
    Input map, required: Digital elevation model to be corrected. Gaps in the elevation map that are located within the area of interest should be filled beforehand, e.g. with r.fillnulls or r.resamp.bspline, to avoid distortions.
  • output
    Output map, required: Hydrologically conditioned digital elevation model. By default, only minor modifications are done and not all sinks are removed.
  • size
    All sinks of up to size cells will be removed. Default is 4, if in doubt, decrease and not increase.
  • mod
    All sinks will be removed that require not more than mod cells to be modifed. Often, rather large sinks can be removed by carving through only few cells. Default is 4, if in doubt, increase and not decrease.
  • -a
    Not recommended if input for r.watershed is generated.
    With the -a flag set, all sinks will be removed using an impact reduction approach based on Lindsay & Creed (2005). The output will be a depression-less digital elevation model, suitable for e.g. r.terraflow or other hydrological analyses that require a depression-less DEM as input.

NOTES

This module is designed for r.watershed with the purpose to slightly denoise a DEM prior to analysis. First, all one-cell peaks and pits are removed, then the actual hydrological corrections are applied. In most cases, the removal of one-cell extrema could already be sufficient to improve r.watershed results in difficult terrain, particularly nearly flat areas.

The impact reduction algorithm used by r.hydrodem is based on Lindsay & Creed (2005), with some additional checks for hydrological consistency. With complete sink removal, results of r.terraflow are very similar to results of r.watershed.

r.hydrodem uses the same method to determine drainage directions like r.watershed.

REFERENCES

Lindsay, J. B., and Creed, I. F. 2005. Removal of artifact depressions from digital elevation models: towards a minimum impact approach. Hydrological Processes 19, 3113-3126. DOI: 10.1002/hyp.5835

SEE ALSO

r.watershed, r.terraflow, r.fill.dir, r.fillnulls, r.resamp.bspline

AUTHOR

Markus Metz

SOURCE CODE

Available at: r.hydrodem source code (history)
Latest change: Friday Feb 21 10:10:05 2025 in commit 7d78fe3