Skip to content

r.mblend

Blends two rasters of different spatial resolution.

r.mblend [-a] [high=string] [low=string] [output=string] [far_edge=value] [inter_points=value] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.mblend

grass.script.run_command("r.mblend", high=None, low=None, output=None, far_edge=95, inter_points=50, flags=None, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.mblend")

Parameters

high=string
    High resolution input raster.
low=string
    Low resolution input raster.
output=string
    Name of output raster.
far_edge=value
    Percentage of distance to high resolution raster used to determine far edge. Number between 0 and 100.
    When the blending occurs along a single edge a number closer to 100 tends to produce more even results. With more blending edges (e.g. high resolution DEM sits on the middle of the low resolution DEM) a lower number may produce a more regular blend.
    Default: 95
inter_points=value
    Number of points to use in interpolation.
    A higher number produces a smoother result but requires a lengthier computation.
    Default: 50
-a
    Assign the average difference between the two rasters to the far edge (instead of zero).

--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

high : str, optional
    High resolution input raster.
low : str, optional
    Low resolution input raster.
output : str, optional
    Name of output raster.
far_edge : float, optional
    Percentage of distance to high resolution raster used to determine far edge. Number between 0 and 100.
    When the blending occurs along a single edge a number closer to 100 tends to produce more even results. With more blending edges (e.g. high resolution DEM sits on the middle of the low resolution DEM) a lower number may produce a more regular blend.
    Used as: value
    Default: 95
inter_points : int, optional
    Number of points to use in interpolation.
    A higher number produces a smoother result but requires a lengthier computation.
    Used as: value
    Default: 50
flags : str, optional
    Allowed values: a
    a
        Assign the average difference between the two rasters to the far edge (instead of zero).

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

This module implements Mblend, a DEM merging method proposed by Leitão et al. (2016). It deals with cases where a study area is only partially covered by a high resolution DEM, with a coarser DEM available for the remainder (as in the case shown below). r.mblend merges the two DEMs, producing a smooth transition from the high resolution DEM to the low resolution DEM.

image-alt

The module works by identifying the edge between the two rasters (near edge, shown in read below) and the edge composed by the cells in the low resolution DEM farther away from the high resolution raster (far edge, shown in blue below). To each point along the near edge is assigned the difference between the two DEMs. To each point in the far edge is assigned the value 0. The Inverse Distance Weighted (IDW) method is then used to interpolate a new raster with the points along the two edges. This interpolated differences raster thus trends from the full difference at the near edge towards zero at the far edge.

image-alt

The differences raster is finally added to the low resolution DEM given as input. In the resulting DEM, cells along the near edge take the values in the high resolution raster. The farther away from the near edge (and closer to to the far edge) the closer is their value is to the low resolution raster, producing a smooth transition, without artefacts.

image-alt

EXAMPLES

Merge the best_dem and other_dem raster maps from the current mapset:

r.mblend high=best_dem low=other_dem output=result

Modifying the far edge distance cut-off:

r.mblend high=best_dem low=other_dem output=result far_edge=90

REFERENCES

J.P. Leitão, L.M. de Sousa, Towards the optimal fusion of high-resolution Digital Elevation Models for detailed urban flood assessment, Journal of Hydrology, Volume 561, June 2018, Pages 651-661, DOI: 10.1016/j.jhydrol.2018.04.043.

L.M. de Sousa, J.P. Leitão, Improvements to DEM Merging with r.mblend. In Proceedings of the 4th International Conference on Geographical Information Systems Theory, Applications and Management - Volume 1: GISTAM, March 2018, pages 42-49. ISBN 978-989-758-294-3 DOI: 10.5220/0006672500420049.

J.P. Leitão, D. Prodanovic, C. Maksimovic, Improving merge methods for grid-based digital elevation models, Computers & Geosciences, Volume 88, March 2016, Pages 115-131, ISSN 0098-3004, DOI: 10.1016/j.cageo.2016.01.001.

AUTHORS

Luís Moreira de Sousa
ISRIC - World Soil Information
João Paulo Leitão
EAWAG: Swiss Federal Institute of Aquatic Science and Technology.

SOURCE CODE

Available at: r.mblend source code (history)
Latest change: Wednesday Feb 26 00:42:43 2025 in commit cd37bac