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 interpolation
    • bilinear: bilinear interpolation
    • bicubic: 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