r.resamp.rst(1)

โœจ r.resamp.rst โ€” the GRASS GIS glow-up page โœจ

okay bestie, welcome to r.resamp.rst(1), straight out of the GRASS GIS User's Manual ๐Ÿ’– This is the one that reinterpolates your raster AND (if you want) does a whole topographic analysis moment, all with regularized spline with tension + smoothing. it's giving main character energy, no cap.


๐ŸŒธ NAME ๐ŸŒธ

Reinterpolates and optionally computes topographic analysis from input raster map to a new raster map (possibly with different resolution) using regularized spline with tension and smoothing. ๐Ÿ’…


๐Ÿท๏ธ KEYWORDS ๐Ÿท๏ธ

raster, resample, splines, RST โœจ


๐Ÿ“œ SYNOPSIS ๐Ÿ“œ

r.resamp.rst
r.resamp.rst --help
r.resamp.rst [-td] input=name ew_res=float ns_res=float
[elevation=name]   [slope=name]   [aspect=name]   [pcurvature=name]
[tcurvature=name]   [mcurvature=name]   [smooth=name]   [maskmap=name]
[overlap=integer]   [zscale=float]   [tension=float]   [theta=float]
[scalex=float]   [--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

๐Ÿšฉ Flags ๐Ÿšฉ

  • -t โ€” Use dnorm independent tension
  • -d โ€” Output partial derivatives instead of topographic parameters
  • --overwrite โ€” Allow output files to overwrite existing files
  • --help โ€” Print usage summary
  • --verbose โ€” Verbose module output
  • --quiet โ€” Quiet module output
  • --ui โ€” Force launching GUI dialog

๐ŸŽ€ Parameters ๐ŸŽ€

  • input=name [required] โ€” Name of input raster map
  • ew_res=float [required] โ€” Desired east-west resolution
  • ns_res=float [required] โ€” Desired north-south resolution
  • elevation=name โ€” Name for output elevation raster map
  • slope=name โ€” Name for output slope map (or fx)
  • aspect=name โ€” Name for output aspect map (or fy)
  • pcurvature=name โ€” Name for output profile curvature map (or fxx)
  • tcurvature=name โ€” Name for output tangential curvature map (or fyy)
  • mcurvature=name โ€” Name for output mean curvature map (or fxy)
  • smooth=name โ€” Name of input raster map containing smoothing
  • maskmap=name โ€” Name of input raster map to be used as mask
  • overlap=integer โ€” Rows/columns overlap for segmentation
    • Default: 3
  • zscale=float โ€” Multiplier for z-values
    • Default: 1.0
  • tension=float โ€” Spline tension value
    • Default: 40.
  • theta=float โ€” Anisotropy angle (in degrees counterclockwise from East)
  • scalex=float โ€” Anisotropy scaling factor

๐Ÿ’– DESCRIPTION ๐Ÿ’–

r.resamp.rst reinterpolates the values from a given raster map (that's your input) onto a brand new raster map (which the docs call elev, and which you name via elevation=). heads up though: this module is meant for reinterpolation of continuous data to a different resolution, not for interpolation from scattered data โ€” for the scattered-data vibe you want the v.surf.* modules instead, iykyk ๐ŸŒˆ

The extent of all the resulting raster maps comes from the settings of the actual computational region (which, yes, can differ from the extent of the input raster map). BUT โ€” and this is important, bestie โ€” the resolution of the computational region has to be aligned to the resolution of the input map, otherwise you get artefacts. ๐Ÿ™ˆ

Reinterpolation (aka resampling) is done to higher, same, or lower resolution, whichever you specify with ew_res and ns_res. ๐Ÿฆ‹

All resulting raster maps are created using the settings of the current region (which may be different from that of the input raster map).

Optionally โ€” and simultaneously with the interpolation, multitasking queen โ€” topographic parameters get computed from an input raster map containing z-values of elevation/depth: slope, aspect, profile curvature (measured in the direction of steepest slope), tangential curvature (measured in the direction of a tangent to contour line) and/or mean curvature are computed and saved as raster maps, as specified by the slope, aspect, pcurv, tcurv, mcurv options respectively. ๐Ÿ’…

If the -d flag is set, the program outputs partial derivatives fx, fy, fxx, fxy, and fyy instead of slope, aspect and curvatures. โœจ

For noisy data you can define spatially variable smoothing by handing over a raster map named by the smooth option, containing smoothing parameters. With the smoothing parameter set to zero (smooth not given, or it contains zero data), the resulting surface passes exactly through the data points. ๐ŸŽฏ

You can also define a raster map (named with maskmap) that gets used as a mask. The interpolation is skipped for cells which have zero or NULL value in the mask. And zero values will be assigned to those cells in all output raster maps. ๐Ÿซถ

The zmult parameter lets you rescale the z-values โ€” super useful, like, for transforming elevations given in feet to meters so the proper values of slopes and curvatures can be computed. Default value is 1. ๐Ÿ“

A regularized spline with tension method is used for the interpolation. The tension parameter tunes the character of the resulting surface from thin plate to membrane. Higher values of the tension parameter reduce the overshoots that can appear in surfaces with a rapid change of gradient. ๐Ÿ”ฅ

The -t flag can be set to use "dnorm independent tension". โญ

The interpolation is performed for overlapping rectangular segments. You can define the width of the overlap (in number of cells) with the overlap option. Default value is 3. ๐Ÿ’€


๐Ÿ“ NOTES ๐Ÿ“

r.resamp.rst uses regularized spline with tension for interpolation (as described in Mitasova and Mitas, 1993). ๐Ÿ‘‘

The region is temporarily changed while writing output files with the desired resolution. Topographic parameters are computed in the same way as in the v.surf.rst module. (See also Mitasova and Hofierka, 1993)

The raster map used with the smooth option should contain variable smoothing parameters. These can be derived from errors, slope, etc. using the r.mapcalc module. ๐Ÿงฎ

The program gives a warning when significant overshoots appear and higher tension should be used. However โ€” and listen closely โ€” with tension set too high, the resulting surface changes its behaviour to a membrane (a rubber sheet stretched over the data points, resulting in a peak or pit in each given point, and everywhere else the surface goes rapidly to trend). Smoothing can be used to reduce the overshoots. When overshoots occur, the resulting elev file will have white color in the locations of overshoots, since the color table for the output file is the same as the colortable for the raster input file. ๐ŸŽจ

The program checks the numerical stability of the algorithm by computing values at given points, and prints the maximum difference found into the history file of raster map elev (view it with r.info). An increase in tension is suggested if the difference is unacceptable. For computations with smoothing set to 0, this difference should be 0. With a smoothing parameter greater than zero, the surface will not pass through the data points exactly, and the higher the parameter, the closer the surface will be to the trend. ๐Ÿ“ˆ

The program writes the values of parameters used in the computation into the comment part of the elev map history file. Additionally, the following values are also written, to assist in the evaluation of results and the choosing of suitable parameters:

  • minimum and maximum z values in the data file (zmin_data, zmax_data) and in the interpolated raster map (zmin_int, zmax_int),
  • maximum difference between the given and interpolated z value at a given point (errtotal),
  • rescaling parameter used for normalization (dnorm), which influences the tension.

The program gives a warning when you try to interpolate outside the region given by the input raster map's header data. Zooming into the area where the points are is suggested in this case. ๐Ÿ”

โš ๏ธ When a mask is used, the program uses all points in the given region for interpolation โ€” including those in the area which is masked out โ€” to ensure proper interpolation along the border of the mask. It therefore does not mask out the data points. If you actually want that, you have to do it outside r.resamp.rst before processing. bestie please read this part twice ๐Ÿ’€

๐Ÿงช EXAMPLE ๐Ÿงช

Resampling the Spearfish 30m resolution elevation model to 15m:

# set computation region to original map (30m)
g.region raster=elevation.dem -p
# resample to 15m
r.resamp.rst input=elevation.dem ew_res=15 ns_res=15 elevation=elev15
# set computation region to resulting map
g.region raster=elev15 -p
# verify
r.univar elev15 -g

slay, look at that workflow โœจ


๐Ÿ“š REFERENCES ๐Ÿ“š

Mitas, L., Mitasova, H., 1999, Spatial Interpolation. In: P.Longley, M.F. Goodchild, D.J. Maguire, D.W.Rhind (Eds.), Geographical Information Systems: Principles, Techniques, Management and Applications, Wiley, 481-492.

Mitasova, H. and Mitas, L., 1993. Interpolation by regularized spline with tension: I. Theory and implementation, Mathematical Geology No.25 p.641-656.

Mitasova, H. and Hofierka, L., 1993. Interpolation by regularized spline with tension: II. Application to terrain modeling and surface geometry analysis, Mathematical Geology No.25 p.657-667.

Talmi, A. and Gilat, G., 1977. Method for smooth approximation of data, Journal of Computational Physics , 23, pp 93-123.

Wahba, G., 1990. Spline models for observational data, CNMS-NSF Regional Conference series in applied mathematics, 59, SIAM, Philadelphia, Pennsylvania.


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

g.region, r.info, r.resample, r.mapcalc, r.surf.contour, v.surf.rst

Overview: Interpolation and Resampling in GRASS GIS ๐ŸŒˆ


๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

Original version of program (in FORTRAN): Lubos Mitas, NCSA, University of Illinois at Urbana Champaign, Il Helena Mitasova, US Army CERL, Champaign, Illinois

Modified program (translated to C, adapted for GRASS , segmentation procedure): Irina Kosinovsky, US Army CERL. Dave Gerdes, US Army CERL.


๐Ÿ’พ SOURCE CODE ๐Ÿ’พ

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

Accessed: Saturday Jan 17 05:40:57 2026

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


and that's a wrap, bestie ๐Ÿซถ this whole page lives at GRASS 8.4.2 (that's r.resamp.rst(1), accessed Saturday Jan 17 05:40:57 2026), and it's all ยฉ 2003-2025 GRASS Development Team, from the GRASS GIS 8.4.2 Reference Manual. periodt ๐Ÿ’…๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from