<< CreateFloatRaster Managing CLaRiNet data structures: "FloatRaster", "FlowDirGrid" and "CellTree" structures CreateRasterFromBinary >>

CLaRiNet 0.1 beta >> Managing CLaRiNet data structures: "FloatRaster", "FlowDirGrid" and "CellTree" structures > CreateFlowDirFromBinary

CreateFlowDirFromBinary

Creates and initializes a flow direction grid from the content of a binary file.

Calling Sequence

handle_fdr = CreateFlowDirFromBinary ( binfile , TYPE , DirCodes [, name] )

Arguments

binfile

character string: path of the binary file to be read. The extension can be anything, but a header file with the same root and with the extension ".hdr" must be present in the same directory.

TYPE

Character string : type of the data to be read and converted to single-precision

'c' : char

'uc' : unsigned char

's' : short int

'us' : unsigned short int

'i' : int

'ui' : unsigned int

'f' : float

'l' : long int

'ul' : unsigned long int

'd' : double

DirCodes

3 x 3 matrix containing the codification of the 8 possible flow directions. ESRI convention is [ 32 , 64 , 128 ; 16 , -9999 , 1 ; 8 , 4 , 2 ]

name

(optional) character string

handle_fdr

integer: handle on the newly created flow direction grid.

Description

Reads a flow direction grid from a binary file (e.g., ESRI Binary Grid .flt). Any numerical type is supported and will be converted to a 1-byte value.

Returns a handle on the new grid.

NB : Objects of type "flow direction grid" ("FlowDirGrid" structures) are distinct from those of type "single-precision floating-point raster" ("FloatRaster" structures). Rasters are stored using 4-bytes records, while flow direction grids only require 1 byte per pixel.

Examples

See Also

Authors

<< CreateFloatRaster Managing CLaRiNet data structures: "FloatRaster", "FlowDirGrid" and "CellTree" structures CreateRasterFromBinary >>