r.surf.random(1grass)

✨ r.surf.random β€” the GRASS User's Manual, bestie edition ✨

okay so welcome to r.surf.random, a lil module from the GRASS fam (that's the manual name babe, r.surf.random(1grass)) that literally just makes a raster surface map full of uniform random deviates in whatever range you feel like. no cap. πŸŽ²πŸ’–


🌈 NAME 🌈

r.surf.random β€” produces a raster surface map of uniform random deviates with a defined range. it's giving "chaos, but make it spatial" πŸ’…


🏷️ KEYWORDS 🏷️

raster, surface, random β€” yes those are the tags, and yes they're accurate, periodt.


πŸ“œ SYNOPSIS πŸ“œ

r.surf.random
r.surf.random --help
r.surf.random [-i] output=name  [min=float]   [max=float]
    [seed=integer]   [--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

🚩 Flags 🚩

  • -i β€” create an integer raster map. whole numbers only bestie, no decimals allowed 🧚
  • --overwrite β€” lets output files overwrite existing files. use with intention okay, this one is powerful πŸ‘‘
  • --help β€” prints the usage summary. when you're lost, she's there 🫢
  • --verbose β€” verbose module output. she tells you everything πŸ’¬
  • --quiet β€” quiet module output. she tells you nothing 🀫
  • --ui β€” force launching the GUI dialog. for the visual girlies πŸŽ€

πŸŽ›οΈ Parameters πŸŽ›οΈ

  • output=name [required] β€” name for the output raster map. you MUST name your baby, there's no skipping this one 😭
  • min=float β€” minimum random value. default: 0
  • max=float β€” maximum random value. default: 100
  • seed=integer β€” seed value for the random number generator. using the same seed ensures identical results, while a randomly generated seed produces different outcomes in each run. lowkey the most important knob here for reproducibility fr fr 🌱

πŸ’« DESCRIPTION πŸ’«

so r.surf.random produces a raster map layer of uniform random deviates whose range can be expressed by the user. it's essentially the same as r.surf.gauss, but uses a linear random number generator instead. iconic sibling energy honestly 🌸

under the hood it uses the random number generator drand48() or rand(), depending on the user's platform. so whichever one your machine vibes with, that's the one you get πŸ¦‹


πŸ”₯ EXAMPLE πŸ”₯

first set up your region:

g.region -p n=228500 s=215000 w=630000 e=645000 res=10
r.surf.random out=random min=0 max=100
# check result
r.univar random

Figure: Random surface example (min: 10; max: 100)

with the histogram tool the cell values versus count can be shown. yes bestie, you can literally see the distribution and it's so satisfying πŸ“Šβœ¨

Figure: Histogram of random surface example (min: 10; max: 100)


πŸ‘€ SEE ALSO πŸ‘€

r.random.surface, r.surf.contour, r.surf.fractal, r.surf.gauss, r.surf.idw, v.surf.rst

(the whole surf squad, go check them out, they ate πŸ’…)


πŸ‘‘ AUTHOR πŸ‘‘

Jo Wood Midlands Regional Research Laboratory (ASSIST) University of Leicester October 1991

shoutout to Jo for real, an absolute legend since '91 πŸ•°οΈπŸ’œ


πŸ“¦ SOURCE CODE πŸ“¦

Available at: r.surf.random source code (history)

Latest change: Thursday May 08 20:58:05 2025 in commit: 4144ba81fa125e1549fc52e1cf5feb4fa004be8b

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

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


and that's the whole page bestie!! 🌈 this gorgeous lil manpage lives in GRASS 8.5.0, and we're sending it off with a mwah πŸ’‹ β€” go make some random surfaces, stay reproducible, and don't forget your seed πŸ“βœ¨

πŸ“¦ where this page comes from