r.resamp.interp(1grass)

r.resamp.interp1grass

Resamples raster map to a finer grid using interpolation.

Usage

r.resamp.interp

r.resamp.interp --help

r.resamp.interp input=name output=name [method=string] [nprocs=integer] [memory=memory in MB] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Keywords

raster, resample, interpolation, nearest neighbor, bilinear, bicubic, lanczos, parallel

Overview

r.resamp.interp resamples an input raster map by interpolating between the neighboring cells via a selectable resampling algorithm. All cells present in the neighborhood of the input raster cell must be non-null to generate a non-null cell in the output raster map. A choice of four interpolation methods is available; each uses the weighted values of a different number of adjacent cells in the input map to determine the value of each cell in the output map as follows:

•

nearest neighbour (1 cell)

•

bilinear (4 cells)

•

bicubic (16 cells)

•

lanczos (25 cells)

This module is intended for reinterpolation of continuous data to a different resolution rather than for interpolation from scattered data (use the v.surf.* modules for that purpose).

Notes

Resampling modules (r.resample, r.resamp.stats, r.resamp.interp, r.resamp.rst) resample the map to match the current region settings.

Note that for bilinear, bicubic and lanczos interpolation, cells of the output raster that cannot be bounded by the appropriate number of input cell centers are set to NULL (NULL propagation). This could occur due to the input cells being outside the current region, being NULL or MASKed.

For longitude-latitude coordinate reference systems, the interpolation algorithm is based on degree fractions, not on the absolute distances between cell centers. Any attempt to implement the latter would violate the integrity of the interpolation method.

Performance

By specifying the number of parallel processes with nprocs option, r.resamp.interp can run significantly faster, see benchmarks below.
Figure: Benchmark shows execution time for different number of cells. See benchmark scripts in source code.

To reduce the memory requirements to minimum, set option memory to zero. To take advantage of the parallelization, GRASS GIS needs to compiled with OpenMP enabled.

Examples

Resample elevation raster map to a higher resolution (from 500m to 250m; North Carolina sample dataset):

g.region raster=elev_state_500m -p
g.region res=250 -ap
r.resamp.interp input=elev_state_500m output=elev_state_250m \
                method=bilinear

Original 500m resolution elevation map

Resampled (bilinear) 250m resolution elevation map

Source code

Available at: r.resamp.interp source code (history)

Accessed: Monday Feb 24 17:50:49 2025

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 7 times.

  1. 6.0
  2. 7
  3. 8
  4. 9
  5. 10
  6. 11
  7. 12
  8. 13

Author

Glynn Clements

From grass-doc 8.4.1-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.