Skip to content

r.surf.idw2

Provides surface interpolation from raster point data by Inverse Distance Squared Weighting.

r.surf.idw2 input=name output=name [npoints=count] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.surf.idw2 input=name output=name

grass.script.run_command("r.surf.idw2", input, output, npoints=12, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.surf.idw2", input="name", output="name")

Parameters

input=name [required]
    Name of input raster map
output=name [required]
    Name for output raster map
npoints=count
    Number of interpolation points
    Default: 12
--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
    Name of input raster map
    Used as: input, raster, name
output : str, required
    Name for output raster map
    Used as: output, raster, name
npoints : int, optional
    Number of interpolation points
    Used as: count
    Default: 12
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.surf.idw2 fills a raster matrix with interpolated values generated from a set of irregularly spaced data points using numerical approximation (weighted averaging) techniques. The interpolated value of a cell is determined by values of nearby data points and the distance of the cell from those input points. In comparison with other methods, numerical approximation allows representation of more complex surfaces (particularly those with anomalous features), restricts the spatial influence of any errors, and generates the interpolated surface from the data points. It is the most appropriate method to apply to most spatial data. The npoints parameter defines the number of points to use for interpolation. The default is to use the 12 nearest points when interpolating the value for a particular cell.

NOTES

The amount of memory used by this program is related to the number of non-zero data values in the input map layer. If the input raster map layer is very dense (i.e., contains many non-zero data points), the program may not be able to get all the memory it needs from the system. The time required to execute increases with the number of input data points.

If the user has a mask set, then interpolation is only done for those cells that fall within the mask. However, all non-zero data points in the input layer are used even if they fall outside the mask.

This program does not work with latitude/longitude data bases. Another surface generation program, named r.surf.idw, should be used with latitude/longitude data bases.

The user should refer to the manual entries for
r.surf.idw
r.surf.contour
v.surf.rst
to compare this surface generation program with others available in GRASS.

KNOWN ISSUES

Module r.surf.idw works only for integer (CELL) raster maps.

SEE ALSO

r.surf.contour, r.surf.idw, r.surf.gauss, r.surf.fractal, r.surf.random, r.surf.idw2, v.surf.rst

AUTHOR

Michael Shapiro, U.S.Army Construction Engineering Research Laboratory

SOURCE CODE

Available at: r.surf.idw2 source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819