Skip to content

r3.out.bin

Exports a GRASS 3D raster map to a binary array.

r3.out.bin [-rdi] input=name output=name [null=float] bytes=integer [order=string] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r3.out.bin input=name output=name bytes=integer

grass.script.run_command("r3.out.bin", input, output, null=0, bytes, order="native", flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r3.out.bin", input="name", output="name", bytes=integer)

Parameters

input=name [required]
    Name of input 3D raster map
output=name [required]
    Name for output file
null=float
    Value to write out for null
    Default: 0
bytes=integer [required]
    Number of bytes per cell in binary file
    Allowed values: 1, 2, 4, 8
order=string
    Output byte order
    Allowed values: big, little, native, swap
    Default: native
-r
    Switch the row order in output from north->south to south->north
-d
    Switch the depth order in output from bottom->top to top->bottom
-i
    Write data as integer
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str, required
    Name of input 3D raster map
    Used as: input, raster_3d, name
output : str, required
    Name for output file
    Used as: output, file, name
null : float, optional
    Value to write out for null
    Default: 0
bytes : int, required
    Number of bytes per cell in binary file
    Allowed values: 1, 2, 4, 8
order : str, optional
    Output byte order
    Allowed values: big, little, native, swap
    Default: native
flags : str, optional
    Allowed values: r, d, i
    r
        Switch the row order in output from north->south to south->north
    d
        Switch the depth order in output from bottom->top to top->bottom
    i
        Write data as integer
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

The r3.out.bin program exports a GRASS 3D raster map to a binary array file. Optionally, output can be send to standard output (stdout) for direct input (pipe) into other applications. Data is exported according to the original GRASS 3D raster type (float, double).

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.

The region parameters are printed to stderr when setting the verbose flag. Export of little and big endian byte order is supported.

Have a look at r3.out.ascii manual page that describes the internal layout of the 3D raster maps and the supported row and depth switch options.

EXAMPLES

Have a look at the examples in r3.in.bin.

SEE ALSO

r3.in.bin, r3.in.ascii

AUTHOR

Sören Gebbert, based on r.out.bin from Bob Covill and Glynn Clements

SOURCE CODE

Available at: r3.out.bin source code (history)
Latest change: Friday Feb 07 19:16:09 2025 in commit a82a39f