r.resamp.rst(1grass)
π r.resamp.rst β the girlies' guide to regularized spline with tension π
okay so bestie, listen. this is r.resamp.rst, a GRASS GIS module, and she is that girl. she takes your raster map and reinterpolates it β and if you're feeling spicy, she'll do a whole topographic analysis on the side. all of it using regularized spline with tension, plus smoothing. it's giving β¨math but make it cuteβ¨. no cap.
πΈ NAME πΈ
r.resamp.rst β reinterpolates and optionally computes topographic analysis from an input raster map to a new raster map (possibly with a different resolution, slay) using regularized spline with tension and smoothing. periodt.
π KEYWORDS π
raster, resample, splines, RST
iykyk.
β¨ 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β usednormindependent tension-dβ output partial derivatives instead of topographic parameters--overwriteβ allow output files to overwrite existing files (be brave, bestie)--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 mapew_res=float[required] β desired east-west resolutionns_res=float[required] β desired north-south resolutionelevation=nameβ name for output elevation raster mapslope=nameβ name for output slope map (orfx)aspect=nameβ name for output aspect map (orfy)pcurvature=nameβ name for output profile curvature map (orfxx)tcurvature=nameβ name for output tangential curvature map (orfyy)mcurvature=nameβ name for output mean curvature map (orfxy)smooth=nameβ name of input raster map containing smoothingmaskmap=nameβ name of input raster map to be used as maskoverlap=integerβ rows/columns overlap for segmentation. Default:3zscale=floatβ multiplier for z-values. Default:1.0tension=floatβ spline tension value. Default:40.theta=floatβ anisotropy angle (in degrees counterclockwise from East)scalex=floatβ anisotropy scaling factor
π DESCRIPTION π
so r.resamp.rst reinterpolates the values a from given raster map (named input) to a new raster map (named elev). she's built for reinterpolating continuous data to a different resolution β not for interpolating from scattered data, bestie. for that whole other situation you want the v.surf.* modules. different vibe entirely.
the extent of all resulting raster maps comes straight from the settings of the actual computational region (which may differ from the extent of the input raster map, ngl). but heads up: the resolution of the computational region has to be aligned to the resolution of the input map, otherwise you get artefacts. and we do not want artefacts. π
reinterpolation (resampling) happens to higher, same or lower resolution β you tell her which with the ew_res and ns_res parameters. she's flexible like that. πββοΈ
all resulting raster maps are created using the settings of the current region (which may be different from the one of the input raster map, yes we said it, it's important).
optionally β and simultaneously with interpolation, multitasking queen β topographic parameters are 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 from and saved as raster maps as specified by the options slope, aspect, pcurv, tcurv, mcurv respectively.
if the -d flag is set, the program outputs partial derivatives fx, fy, fxx, fxy, and fyy instead of slope, aspect and curvatures. pick your fighter.
for noisy data it is possible to define spatially variable smoothing by providing a raster map named by the smooth option containing smoothing parameters. with the smoothing parameter set to zero (smooth is not given or contains zero data), the resulting surface passes exactly through the data points. no filter, no nothing, just pure data. π«Ά
you can also define a raster map (named with maskmap) which will be used as a mask. the interpolation is skipped for cells which have zero or NULL value in the mask.
zero values will be assigned to these cells in all output raster maps. bestie that's literally what it does, don't be surprised.
the zmult parameter allows you to rescale the z-values, which may be useful β e.g. for transformation of elevations given in feet to meters β so that the proper values of slopes and curvatures can be computed. the 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 tension parameter reduce the overshoots that can appear in surfaces with rapid change of gradient. it's giving glow-up for your surface. β¨
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 overlap (in number of cells) with the overlap option. the default value is 3.
π NOTES π
r.resamp.rst uses regularized spline with tension for interpolation (as described in Mitasova and Mitas, 1993). iconic behavior.
the region is temporarily changed while writing output files with 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. go off, r.mapcalc.
the program gives warning when significant overshoots appear and higher tension should be used. however β and this is the plot twist β with tension set too high the resulting surface changes its behavior to a membrane (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 colortable for raster input file. so if you see white patches, that's not aesthetic, that's a warning π
the program checks the numerical stability of the algorithm by computation of values at given points, and prints the maximum difference found into the history file of raster map elev (view 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 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 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 the user wants 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. fr fr, just zoom in.
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 this is desirable, it must be done outside r.resamp.rst before processing. yes bestie, she's using the hidden points. it's for the border. trust the process. π
π EXAMPLE π
resampling the Spearfish 30m resolution elevation model to 15m β the classic:
# 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
ate. π
π 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
π 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)
okay and for the cute sign-off, bestie: the latest change to this absolute legend was Friday Aug 08 09:39:19 2025, in commit ed72c71d8580e872cd6fd345c84a15c324764465. π«Ά
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual
GRASS 8.5.0 β r.resamp.rst(1grass). that's the whole page, go slay some interpolation, mwah πβ¨π
π¦ 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