r.out.ascii(1)

✨ r.out.ascii ✨

okay bestie, so this is r.out.ascii(1) from the GRASS GIS User's Manual and it's literally the glow-up your raster needs to go from GRASS-flavored to plain-ASCII-text-flavored πŸ’…

KEYWORDS: raster, export, output, ASCII πŸŽ€


🌈 SYNOPSIS 🌈

r.out.ascii
r.out.ascii --help
r.out.ascii [-hsmi] input=name  [output=name]   [precision=integer]
[width=integer]   [null_value=string]   [--overwrite]  [--help]
[--verbose]  [--quiet]  [--ui]

✨ Flags ✨

  • -h β€” suppress printing of header information πŸ™ˆ like, no context, just vibes
  • -s β€” write SURFER (Golden Software) ASCII grid πŸ„
  • -m β€” write MODFLOW (USGS) ASCII array 🌊
  • -i β€” force output of integer values πŸ”’ no decimals, we're being whole about it
  • --overwrite β€” allow output files to overwrite existing files πŸ’€ (yes she will eat your old file, that's the deal)
  • --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 πŸ‘‘ the main character
  • output=name β€” name for output ASCII grid map (use out=- for stdout) 🧚
  • precision=integer β€” number of significant digits (floating point only) πŸ”¬
  • width=integer β€” number of values printed before wrapping a line (only SURFER or MODFLOW format) πŸ“
  • null_value=string β€” string to represent null cell (GRASS grid only)
    • Default: *

πŸ’– DESCRIPTION πŸ’–

r.out.ascii converts a user-specified raster map layer (input=name) into an ASCII grid in a text file (output=name) suitable for export to other computer systems. it's giving ✨interoperability✨

the GRASS program r.in.ascii can be used to perform the reverse function, converting an ASCII file in suitable format to GRASS raster map format. so they're like, opposites, a matched set, besties fr fr 🫢

to write a SURFER .grd ASCII GRID file (with reverted row order and different header) use the -s flag:

r.out.ascii -s input=inname output=outname.grd [dp=value]

NULL data are coded to "1.70141e+038" for SURFER ASCII GRID files (ignoring the null= parameter). no cap, that number is doing the absolute most πŸ”₯


πŸ“ NOTES πŸ“

the output from r.out.ascii may be placed into a file by using the UNIX redirection mechanism; e.g.:

r.out.ascii input=soils output=- > out.file

the output file out.file can then be printed or copied onto a CDROM or floppy disk for export purposes. floppy disk. yes. iconic retro tech moment πŸ’Ύβœ¨

to export the raster values as x,y,z values of cell centers (one per line) use the r.out.xyz module. different module, different slay πŸ¦‹


πŸ‘€ SEE ALSO πŸ‘€

r.in.ascii, r.in.gdal, r.out.bin, r.out.gdal, r.out.xyz


🌸 AUTHORS 🌸

  • Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
  • Surfer support by Markus Neteler

πŸ“¦ SOURCE CODE πŸ“¦

Available at: r.out.ascii source code (history)

Accessed: Saturday Jan 17 05:40:51 2026

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


and that's the whole thing bestie, we ate and left no crumbs πŸ’…βœ¨ this was GRASS GIS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team, accessed Saturday Jan 17 05:40:51 2026, and honestly? iconic behavior from everyone involved πŸ«ΆπŸŒˆπŸ’–

πŸ“¦ where this page comes from