
AscToRaw |
util.AscToRaw |
This code is for converting an ascii raster file into a binary *.raw file.
The raw file is just a sequence of row x col bytes, scaled appropriately.
The ascii raster has several header lines, followed by one row of ascii space-delimited
values per line
Typical header lines:
ncols 720
nrows 360
xllcorner -180.0
yllcorner -90
cellsize 0.5
NODATA_value -9999
Author(s): Dan Higgins NCEAS UC Santa Barbara
Version:
inputAscFilenameArrayPort
An array of file names of *.ASC files that are to be used as GARP spatial layer inputs
singleFilenamePort
A single ASC grid file name to be converted to RAW format
outputValuesPort
Either an XML (*.dxl) file name (if array input) or a single RAW file name (if single
ASC file input)
outputRawFilename
used to specify the output RAW filename
dxlFilename
used to specify the output dxl filename
EnvLayerSetIdParameter
used to specify an EnvironmentSetId in the dxl file
EnvLayerSetTitleParameter
used to specify an Environment Title in the dxl file
scaleRaw
In some cases it is not desirable to scale the input ASC file (e.g. when the ASC
file already represents data that is in the range of 0-255)
A 'scaleRaw' parameter is thus defined with a default value of 'true'
Note that the setting of this parameter is ignored if the range of
values is outside range 0.0 to 255.0