[GRASSLIST:1441] Re: import .bil DEM file (cascadia.bil)

Hamish hamish_nospam at yahoo.com
Wed Oct 8 04:18:49 EDT 2003


> I tried again to import that *.bil file, as some time has gone by
> since my initial attempts.


a little more ideas..


From:  http://geopubs.wr.usgs.gov/open-file/of99-369/

"Elevations are stored in cascadia.bil as unsigned positive 2-byte
binary integers, in Motorola byte-order (default for Sun hardware), with
an offset of 10000. That is, 203 meters is stored as 10203 meters, and
values less than 10000 represent negative elevations. Values of 0 in
cascadia.bil represent no data. Values are given by row, west to east,
starting at the north edge of the region."


so try without the -s signed-bit flag, with the -b byteswap flag[*], 
and with anull=0.

[*] SUN is big endian, I assume you are importing to little endian (PC)?


so that makes it:

GRASS:~ > r.in.bin -b input=cascadia.bil output=cascadia.grass bytes=1 \
north=1710340.289 south=101590.289 east=749705.938 west=-738044.062 \
r=6435 c=5951 bytes=2 anull=0


but still check the +/- 125.0, you may need to adjust the edges.


finally recorrect the z-values with:

GRASS:~ > g.region rast=cascadia.grass
GRASS:~ > r.mapcalc "cascadia.grass = cascadia.grass - 10000"



hope it works,
Hamish




More information about the grass-user mailing list