GRASS logo

NAME - Imports a binary raster file into a GRASS 3D raster map.


raster3d, import, voxel

SYNOPSIS --help [-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]


Switch the row order in output from north->south to south->north
Switch the depth order in output from bottom->top to top->bottom
Binary data is of type integer
Signed data (two's complement)
Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


input=name [required]
Name of binary 3D raster file to be imported
output=name [required]
Name for output 3D raster map
bytes=integer [required]
Number of bytes per cell in binary file
Options: 1, 2, 4, 8
Byte order in binary file
Options: big, little, native, swap
Default: native
north=float [required]
Northern limit of geographic region (outer edge)
south=float [required]
Southern limit of geographic region (outer edge)
east=float [required]
Eastern limit of geographic region (outer edge)
west=float [required]
Western limit of geographic region (outer edge)
bottom=float [required]
Bottom limit of geographic region (outer edge)
top=float [required]
Top limit of geographic region (outer edge)
rows=integer [required]
Number of rows
cols=integer [required]
Number of columns
depths=integer [required]
Number of depths
Set Value to NULL

Table of contents

DESCRIPTION allows a user to create a GRASS 3D raster map from a variety of binary 3D raster data formats.

The top, bottom, north, south, east, and west field values entered are the coordinates of the edges of the geographic region. The depths, rows and cols field values entered describe the dimensions of the matrix of data to follow. If the bytes field is entered incorrectly an error will be generated suggesting a closer bytes value.


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.

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

Import of little and big endian byte order as well as signed and unsigned integer data types is supported.


First we create a specific region and a 3D raster map that we will export with r3.out.bin and import again.
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 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


r3.out.bin,, r3.out.ascii


Soren Gebbert, based on from Jacques Bouchard and Bob Covill


Available at: source code (history)

Latest change: Thursday Jan 26 14:10:26 2023 in commit: cdd84c130cea04b204479e2efdc75c742efc4843

Main index | 3D raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2024 GRASS Development Team, GRASS GIS 8.3.3dev Reference Manual