r.resamp.interp(1grass)
π r.resamp.interp π
okay bestie, gather round, because this is the GRASS module that takes your raster map and glow-ups it onto a finer grid using interpolation. it's r.resamp.interp from the GRASS User's Manual, and she is genuinely iconic. no cap. π«Ά
β¨ KEYWORDS β¨
raster, resample, interpolation, nearest neighbor, bilinear, bicubic, lanczos, parallel
πΈ SYNOPSIS πΈ
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]
π Flags π
--overwriteβ bestie this lets your output files just... overwrite the existing ones. yes really. allow output files to overwrite existing files.--helpβ prints the usage summary so you're not lost. π§--verboseβ verbose module output, aka she tells you everything she's doing.--quietβ quiet module output. she says nothing. mysterious. π--uiβ force launching the GUI dialog, for when you want the pretty buttons.
π¦ Parameters π¦
input=name[required] β name of the input raster map. mandatory, she needs to know what we're working with. βoutput=name[required] β name for the output raster map. also mandatory, obviously.method=stringβ sampling interpolation method. Options:nearest,bilinear,bicubic,lanczos. Default:bilinear.nearest: nearest-neighbor interpolationbilinear: bilinear interpolationbicubic: bicubic interpolation
nprocs=integerβ number of threads for parallel computing.0: use OpenMP default;>0: use nprocs;<0: use MAX-nprocs. Default:0. yes queen, go parallel π₯memory=memory in MBβ maximum memory to be used (in MB). it's the cache size for raster rows. Default:300.
π DESCRIPTION π
so r.resamp.interp resamples an input raster map by interpolating between the neighboring cells, via a selectable resampling algorithm. β¨
here's the tea though, and this part matters a LOT: 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. like, all of them. no skips. π
you've got a choice of four interpolation methods, and each one uses the weighted values of a different number of adjacent cells in the input map to figure out the value of each cell in the output map, like this:
- nearest neighbour (1 cell)
- bilinear (4 cells)
- bicubic (16 cells)
- lanczos (25 cells)
and btw, this module is intended for reinterpolation of continuous data to a different resolution β not for interpolation from scattered data. if that's what you need, go use the v.surf.* modules, that's literally their whole job. π
π NOTES π
the resampling modules (r.resample, r.resamp.stats, r.resamp.interp, r.resamp.rst) resample the map to match the current region settings. so check your region, bestie, i'm begging. π
also, important: 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 (that's NULL propagation, iykyk). this could happen because the input cells are outside the current region, are NULL, or are masked. so if you're seeing surprise NULLs, that's why. π
and 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. so like, don't. it's not a vibe. periodt.
π PERFORMANCE π
okay so this is the fun part. by specifying the number of parallel processes with the nprocs option, r.resamp.interp can run significantly faster, see the benchmarks below. π
Figure: Benchmark shows execution time for different number of cells. See benchmark scripts in source code.
to reduce the memory requirements to the minimum, set the option memory to zero. and to take advantage of the parallelization, GRASS needs to be compiled with OpenMP enabled. if it's not, no parallel speedup for you, sorry babe. π
β EXAMPLE β
resample an 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
π SEE ALSO π
g.region, r.resample, r.resamp.filter, r.resamp.rst, r.resamp.stats
Overview: Interpolation and Resampling in GRASS
π«Ά AUTHOR π«Ά
Glynn Clements
π SOURCE CODE π
Available at: r.resamp.interp source code (history)
Latest change: Friday Aug 08 09:39:19 2025 in commit: ed72c71d8580e872cd6fd345c84a15c324764465
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page, bestie π she's from the GRASS Development Team, Β© 2003-2026, GRASS 8.5.0 Reference Manual β and the footer's version is GRASS 8.5.0 on r.resamp.interp(1grass). go resample something gorgeous. slay. π
β¨
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms