r.out.bin(1)

πŸ’Ύ r.out.bin β€” the GRASS GIS User's Manual era πŸ’Ύ

okay bestie, gather round, because we're talking about r.out.bin from the GRASS GIS User's Manual and she is that girl πŸ’…


✨ NAME ✨

r.out.bin β€” exports a GRASS raster to a binary array. literally what it says on the tin, no cap 🫢


🏷️ KEYWORDS 🏷️

raster, export, output


🌈 SYNOPSIS 🌈

r.out.bin
r.out.bin --help
r.out.bin [-ifhbs] input=string  [output=string]   [null=float]
[bytes=integer]   [order=string]   [--help]  [--verbose]  [--quiet]
[--ui]

🚩 Flags 🚩

  • -i β€” generate integer output (int era, we love her)
  • -f β€” generate floating-point output (float girlie, also iconic)
  • -h β€” export array with GMT compatible header πŸ‘‘
  • -b β€” generate BIL world and header files
  • -s β€” byte swap output πŸ”„
  • --help β€” print usage summary
  • --verbose β€” verbose module output (she talks a LOT, respect)
  • --quiet β€” quiet module output (shhh era 🀫)
  • --ui β€” force launching GUI dialog

πŸŽ€ Parameters πŸŽ€

  • input=string [required] β€” name of input raster map. yes bestie, you HAVE to give her this one, it's not optional fr fr
  • output=string β€” name for output binary map (use output=- for stdout)
  • null=float β€” value to write out for null. default: 0
  • bytes=integer β€” number of bytes per cell. options: 1, 2, 4, 8
  • order=string β€” output byte order. options: big, little, native, swap. default: native

πŸ’– DESCRIPTION πŸ’–

so the r.out.bin program exports a GRASS raster map to a binary array file. yes. an actual binary array file. she's giving data conversion main character energy ✨

optionally, the output can be sent to standard output (stdout) so you can pipe it directly into other applications β€” like, she's flexible, she's accommodating, she's a team player 🫢

data is exported according to the original GRASS raster type (e.g. float). but if you specify the -i flag, an integer array is output instead. glow-up moment.

oh and heads up: the region parameters are printed to stderr. not stdout. stderr. don't get it twisted πŸ’€


πŸ“ NOTES πŸ“

with the -h flag, the data can be directly used by GMT as Grid Format 1 (float) or 2 (short). for example:

r.out.bin -h input=grass.raster output=new.grd
grdinfo new.grd=1 (if float)

exported data can also be piped directly into the GMT program xyz2grd. the way that pipes just WORK 😭

r.out.bin input=grass.raster output=- | xyz2grd -R....  -ZTLf -

the example uses the GMT program xyz2grd with the -ZTLf flag indicating that a float array was output. see, details matter, always read the flags bestie πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

  • r.in.bin
  • r.in.ascii
  • r.in.gdal
  • r.out.ascii

go read those too, they're all in the same friend group fr fr πŸ¦‹


🧚 AUTHOR 🧚

this program is derived from r.out.ascii with a few modifications.

author: Bob Covill πŸ‘‘


🌸 SOURCE CODE 🌸

available at: r.out.bin 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 vibe check, bestie πŸ’œ the GRASS Development Team has been holding it down with the Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual β€” this page lives in the GRASS 8.4.2 era, r.out.bin(1), and honestly? she ate. periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from