NAME

r.in.bin - Import a binary raster file into a GRASS raster map layer.
(GRASS Raster Data Import Program)

SYNOPSIS

r.in.bin
r.in.bin help
r.in.bin [-s] input=name output=name [TITLE="phrase"] [mult=value] [bytes=value] north=value south=value east=value west=value r=value c=value [subst=old,new]

DESCRIPTION

r.in.bin allows a user to create a (binary) GRASS raster map layer from a binary raster input file with (optional) TITLE.

OPTIONS

Flags:

-s
Signed data (high bit means negative value)

Parameters:

input=name
Name of an existing ASCII raster file to be imported.
output=name
Name to be assigned to resultant binary raster map layer.
TITLE="phrase"
Title to be assigned to resultant raster map layer.
mult=value
Multiply all raster cell values by value. value is a floating point value, and has a default value of 1.0.
bytes=value
Number of bytes per cell (1, 2, 4), default: 1
north=value
Northern limit of geographic region
south=value
Southern limit of geographic region
east=value
Eastern limit of geographic region
west=value
Western limit of geographic region
r=value
Number of rows
c=value
Number of columns
subst=old,new
Replace 1st value by 2nd one, default: 0,0
The north, south, east, and west field values entered are the coordinates of the edges of the geographic region. The rows and cols field values entered describe the dimensions of the matrix of data to follow. The data which follows is r rows of c integers.

EXAMPLE

The following is a sample call of r.in.bin to import GTOPO30 DEM data:

r.in.bin -s input=E020N90.DEM output=gtopo30 bytes=2 north=90 south=40 east=60 west=20 r=6000 c=4800

(you can add "subst=-9999,0" if you want sea level to have 0 value)

NOTES

The geographic coordinates north, south, east, and west describe the outer edges of the geographic region. They run along the edges of the cells at the edge of the geographic region and not through the center of the cells at the edges.

Notes on (non)signed data:

If you use the -s flag the highest bit is the sign bit. If this is 1 the data is negative, and the data interval is half of the unsigned (not exactly). For example:

Data: 2 byte
Unsigned interval: 0x0000 -> 0xFFFF = 0 -> 65535 decimal = 00000000 00000000 ->11111111 11111111 binary.
Signed interval: 0x8000 -> 0xFFFF; 0x0000 -> 0x7FFF = -32768 -> -1; 0 -> 32767 = 10000000 00000000 -> 11111111 11111111; 00000000 00000000 -> 01111111 11111111 binary.

This is the 2's complement representation.
So if the data 1 byte the integer range is -128 -> 127, if 2 byte (16 bit, word) -32768 -> 32767, if 4 byte (32 bit, doubleword, Dword) -2^31 -> 2^31-1. And of course the value zero has a positive sign.

SEE ALSO

r.in.ascii, r.out.ascii, r.in.arc, r.out.arc

AUTHOR

Jacques Bouchard, France (bouchard@onera.fr)
Man page: Zsolt Felker (felker@c160.pki.matav.hu)