r3.in.bin(1grass)

πŸ’– r3.in.bin β€” the GRASS module page, but make it make sense πŸ’–

okay bestie, sit down, hydrate, because we're importing binary raster files into GRASS 3D raster maps and honestly? it's giving main character energy. this is r3.in.bin from the GRASS User's Manual, and i'm gonna walk you through every single flag like your favorite study buddy who actually read the whole thing. πŸ¦‹

✨ NAME ✨

r3.in.bin β€” imports a binary raster file into a GRASS 3D raster map. that's it, that's the whole job. voxels. in. πŸ’…

🌸 KEYWORDS 🌸

raster3d, import, voxel


πŸŽ€ SYNOPSIS πŸŽ€

no cap, here's exactly how you call her:

r3.in.bin
r3.in.bin --help
r3.in.bin [-rdis] input=name output=name bytes=integer  [order=string]
north=float south=float east=float west=float bottom=float top=float
rows=integer cols=integer depths=integer  [null=float]   [--overwrite]
[--help]  [--verbose]  [--quiet]  [--ui]

πŸ”₯ FLAGS πŸ”₯

listen, flags are the little switches that change the vibe. here's literally every one:

  • -r β€” switches the row order in the output from north->south to south->north. flipping the script, literally.
  • -d β€” switches the depth order in the output from bottom->top to top->bottom. yes, also a flip. depths this time.
  • -i β€” tells it the binary data is of type integer. ok so it's not float, noted ✍️
  • -s β€” signed data (two's complement). we love a signed queen.
  • --overwrite β€” allows output files to overwrite existing files. chaotic but valid, use with intention bestie 🫢
  • --help β€” prints the usage summary. when in doubt, ask for help. iconic.
  • --verbose β€” verbose module output. it will simply tell you everything.
  • --quiet β€” quiet module output. the opposite vibe.
  • --ui β€” forces launching the GUI dialog. for the visual learners ✨

🧚 PARAMETERS 🧚

now the actual arguments, one by one, no skips:

  • input=name [required] β€” name of the binary 3D raster file to be imported. yes it's required. yes you must say it.
  • output=name [required] β€” name for the output 3D raster map. also required. also must be said.
  • bytes=integer [required] β€” number of bytes per cell in the binary file. options are: 1, 2, 4, 8. pick one, bestie, don't guess.
  • order=string β€” byte order in the binary file. options: big, little, native, swap. default is native.
  • north=float [required] β€” northern limit of the geographic region (outer edge).
  • south=float [required] β€” southern limit of the geographic region (outer edge).
  • east=float [required] β€” eastern limit of the geographic region (outer edge).
  • west=float [required] β€” western limit of the geographic region (outer edge).
  • bottom=float [required] β€” bottom limit of the geographic region (outer edge).
  • top=float [required] β€” top limit of the geographic region (outer edge).
  • rows=integer [required] β€” number of rows.
  • cols=integer [required] β€” number of columns.
  • depths=integer [required] β€” number of depths.
  • null=float β€” set value to NULL. give your no-data cells a little identity πŸŒ™

🌈 DESCRIPTION 🌈

okay so here's the tea: r3.in.bin allows a user to create a GRASS 3D raster map from a variety of binary 3D raster data formats. variety! plural! she's flexible.

the top, bottom, north, south, east, and west field values you enter are the coordinates of the edges of the geographic region. meanwhile the depths, rows and cols field values you enter describe the dimensions of the matrix of data that's about to follow. so like, where it lives and how big it is. both matter. both. 🌸

and hmm, one thing: if the bytes field is entered incorrectly, an error will be generated suggesting a closer bytes value. it's not gonna silently let you cook β€” it'll gently nudge you toward the right number. 🫢


πŸ’œ NOTES πŸ’œ

  • the write order of the rows (north->south to south->north) and the write order of the depths (bottom->top to top->bottom) can be switched. your data, your order, your rules.
  • go have a look at the r3.out.ascii manual page β€” it describes the internal layout of the 3D raster maps and the supported row and depth switch options. it's basically the lore drop you need iykyk.
  • import of little and big endian byte order as well as signed and unsigned integer data types is supported. all of them. she does not discriminate. πŸ‘‘

⭐ EXAMPLES ⭐

first we create a specific region and a 3D raster map that we will export with r3.out.bin and import again. full circle moment, honestly.

g.region w=0 e=180 s=0 n=90 b=0 t=100 res3=10
r3.mapcalc expr="test_out_bin_float = float(if(row() == 2, null(), row()))"
r3.out.bin input=test_out_bin_float byte=4 null=-9999 \
    output=test_out_bin_float_native_b4.bin order=native
r3.in.bin output=test_in_bin_float byte=4 null=-9999 \
    input=test_out_bin_float_native_b4.bin order=native \
    bottom=0 top=100 west=0 east=180 south=0 north=90 \
    cols=18 rows=9 depths=10

and that's it. exported, imported, slayed. πŸ”₯


πŸ¦‹ SEE ALSO πŸ¦‹

  • r3.out.bin
  • r3.in.ascii
  • r3.out.ascii

πŸ‘‘ AUTHORS πŸ‘‘

Soren Gebbert, based on r.in.bin from Jacques Bouchard and Bob Covill


πŸ“ SOURCE CODE πŸ“

available at: r3.in.bin source code (history)

latest change: Friday Feb 07 19:16:09 2025 in commit a82a39f673b97fafcfce1604dc3e6015cb96487a

main index | 3D raster index | topics index | keywords index | graphical index | full index

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


no cap, that's the whole page. every flag, every default, every coordinate, every endian, untouched. i just made it fun. πŸ’…βœ¨

mwah πŸ’– this was r3.in.bin from the GRASS 8.5.0 Reference Manual β€” footer said it, not me: GRASS 8.5.0, r3.in.bin(1grass). go import something cute 🌈

πŸ“¦ where this page comes from