Summary: Arc GRID -> GRASS cell | TIFF
Conn Copas
conn.copas at dsto.defence.gov.au
Fri Feb 27 06:41:26 EST 1998
Thanks to David Lounsbury <david at catgis.dep.nyc.ny.us>, Chris <clay at mk.com> and
especially Eric Pyle <ericp at vcgi.uvm.edu> for useful tips on GRID -> GRASS.
As the docs suggest, 'gridimage' will not write directories, only files. At
a minimum, this directory structure must be created in advance:
$GISDBASE/$LOCATION/$MAPSET/cell
$GISDBASE/$LOCATION/$MAPSET/cellhd
where $GISDBASE is an absolute path spec. If intending to output a colour map,
add a "colr" directory as well. GISDBASE may either be defined as an
environment var, or given as part of the path spec for the output file. The
other two vars cannot be defined in the environment. It may also be a quirk
of my system (Solaris2.5/Arc7.1), but I am unable to define environment vars
successfully at the arc prompt, ie, I had to do it before starting arc. A
DEFAULT_WIND file is not required, and the $GISRC file is not read.
The main trick is that colons are required in the output file spec, eg,
gridimage <in_file> <colour_map> $LOCATION:$MAPSET:<layer_name> grass
<compression>
The Grass file is then regarded as a piece of imagery which may be "described",
but I am unaware of any Arc commands for listing the values of an image file.
'r.report' will of course do this in Grass.
An initial region specification may be obtained by copying cellhd/<layer_name>
to $MAPSET/DEFAULT_WIND, after stripping out the "format" and the
"compressed" specifications.
I originally asked whether Arc would automatically reduce the data to 256
values if necessary, before being aware that Grass4.2 handles +/- 32bits. The
good news is that Arc doesn't choke and doesn't reduce the data, the bad news
is that the output seems wrong (eg, no negative values, and too many zeroes).
I assume that is to do with incompatibilities in low-level data representation.
I didn't have any missing data, so no ideas what happens in that case.
The "format" value written to cellhd/<layer_name> is also incorrect. The value
should range from 0-3, but Arc wrote a large negative number for 16bit data.
I also complained about TIFF output from gridimage, after a file with 256 values
resulted in a TIFF with 16bit pixel depth. My problem was the range was 1-256,
not 0-255.
More information about the grass-user
mailing list