r.rescale(1grass)

✨ r.rescale β€” GRASS User's Manual (but make it cute) ✨

okay bestie, welcome to the r.rescale(1grass) page πŸ’– this is the GRASS GIS manual entry, and I'm gonna walk you through it like we're texting at 1am. no cap, every single detail is in here. slay.

KEYWORDS: raster, rescale πŸ¦‹


🌸 SYNOPSIS 🌸

r.rescale
r.rescale --help
r.rescale input=name  [from=min,max]  output=name to=min,max
[title=phrase]   [--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags

  • --overwrite β€” lets your output files just bulldoze over whatever files already exist there. it's giving main character energy, use responsibly πŸ’…
  • --help β€” prints the usage summary so you're not out here guessing
  • --verbose β€” verbose module output, aka it tells you everything it's doing
  • --quiet β€” quiet module output, aka it shuts up and just works 🀫
  • --ui β€” forces a GUI dialog to pop up. slay, a little window moment ✨

πŸ“ Parameters

  • input=name [required] β€” the name of the raster map you wanna rescale, periodt
  • from=min,max β€” the input data range to be rescaled. default? the full range of the input map, iykyk
  • output=name [required] β€” the name of the resulting raster map. name it something cute πŸŽ€
  • to=min,max [required] β€” the output data range. yes you MUST tell it where you're going
  • title=phrase β€” a title for the new raster map, because your map deserves a name 🫢

πŸ’œ DESCRIPTION πŸ’œ

so the way that r.rescale works is it rescales the range of category values that show up in a raster map layer. it makes a whole new raster map layer for you β€” plus an appropriate category file and a color table, both based on the original raster map layer β€” and the category labels it generates reflect the original category values that produced each category. iconic behavior, honestly.

why would you want this? because it's lowkey perfect for making representations with a reduced number of categories out of a raster map layer that has a huge range of category values (elevation, for example β€” elevation rasters be having SO many values 😭). and the rescaled map layers you get are appropriate for use in GRASS commands like r.stats, r.report, and r.coin. periodt. πŸ’…


πŸ”₯ EXAMPLE πŸ”₯

say you wanna rescale an elevation raster map layer whose category values range from 1090 meters to 1800 meters into the range 0-255. the command line would look like this (and heads up: if you leave out the from parameter, the full value range gets used):

r.rescale input=elevation from=1090,1800 output=elevation.255 to=0,255

look at that. chef's kiss. ✨


⚠️ NOTES ⚠️

okay this part is important, bestie, don't skip it:

  • category values that fall beyond the input range will become NULL. not a vibe, but it's the rule. πŸ’€
  • that actually means the user can select a subset of the full category value range for rescaling if they want to. cute and flexible!
  • BUT it also means the user should know the category value range for the input raster map layer. know your data, bestie.
  • you can ask the r.rescale program to determine this range for you, OR you can get it yourself using the r.describe or r.info command.
  • if the category value range is determined using r.rescale, then the input raster map layer gets examined, and the minimum and maximum non-NULL category values are selected as the input range. no cap.

🌈 SEE ALSO 🌈

  • r.coin
  • r.describe
  • r.info
  • r.mapcalc
  • r.reclass
  • r.rescale.eq
  • r.report
  • r.resample
  • r.stats
  • r.univar

all of these are your besties too, go say hi πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Michael Shapiro, U.S.Army Construction Engineering Research Laboratory


🧚 SOURCE CODE 🧚

Available at: r.rescale source code (history)

Latest change: Wednesday May 21 09:11:03 2025 in commit: 45102055f4f205276ad5f85b5775b70c6583a26f

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

Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual


okay that's the whole page, you made it to the end, I'm so proud of you πŸ₯ΉπŸ«Ά this was GRASS 8.5.0, the reference manual is Β© 2003-2026 GRASS Development Team, and the whole thing lives in the r.rescale(1grass) manual entry. go rescale something gorgeous, bestie. mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from