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

Torge Schuemann ts at uvic.ca
Tue Oct 7 21:36:34 EDT 2003


Hi Daniel and the others,

I tried again to import that *.bil file, as some time has gone by since my 
initial attempts.
In general I have to admit that I am a newbee to GIS and my general 
approach to projections etc. is very much try and error ...

I am working in a Lat/Lon location, the cascadia.bil file reflects a UTM 
location - does that cause additional problems?
However, I tried to import it into both types of locations without success.
I get complaints about "bytes not match File size" regardless what I try 
... (see below)

Thanks,

Torge

*** Lat/Lon location ***
GRASS:~/geodata/dem/cascadia > r.in.bin -s input=cascadia.bil 
output=cascadia.grass bytes=1 north=53 south=39 east=244 west=227
Using rows=14 cols=17
Bytes do not match File size
File Size 76589370 ... Total Bytes 238
Try bytes=321804 or adjusting input parameters

*** UTM location ***
GRASS:~/geodata/dem/cascadia > r.in.bin -s input=cascadia.bil 
output=cascadia.grass bytes=1 north=1710340.289 south=101590.289 
east=749705.938 west=-738044.062
Using rows=1608749 cols=1487749
Bytes do not match File size
File Size 76589370 ... Total Bytes 1117932129
Try bytes=0 or adjusting input parameters

On Tue, 7 Oct 2003 17:04:21 -0700 (PDT), Daniel Victoria 
<daniel_victoria at yahoo.com> wrote:

> You should be able to import the file using r.in.bin.
> I don't have my linux box on now so I can't remember
> the command but I think you must have the header file
> with the same name as the bill file (just different
> extension .bil and .hdr)
>
> Also, you will have to play arounf with the bite
> swaping option. Can't remember now if the motorola
> (sun) needs bite swap on or off. Import and check the
> values, if they are off than change the biteswap.
> Acording to what you sent, the values - before
> correcting for the offset - should range from 400 to
> something in the order of 5000
>
> Hope to have helped
>
> Daniel
>
> --- Torge Schuemann <ts at uvic.ca> wrote:
>> Hi,
>>
>> for quite a while I am trying to import a *.bil file
>> into GRASS 5.0.1 by
>> using various modules (r.in.bin and r.in.gdal).
>> I am not familliar with the *.bil format, but the
>> archive "cascdem.tar.gz"
>> I downloaded from
>> http://geopubs.wr.usgs.gov/open-file/of99-369/
>> includes
>> some meta data which I applied when using the import
>> modules.
>>
>> However, so far I haven't been lucky although I
>> think I more or less tried
>> every possible combination of the parameters given
>> below.
>>
>> As info for the data set itself: It contains a
>> 250-meter digital elevation
>> model (DEM) for Cascadia (latitude 39N - 53N,
>> longitude 116W - 133W), a
>> region that encompasses the Cascade volcanic arc,
>> the Cascadia subduction
>> zone, and the Juan de Fuca Ridge system offshore
>> Washington (USA) and
>> British Columbia (Canada).
>>
>> Any help is appreciated, thank you all!
>>
>> Cheers, Torge
>>
>> Here below I copied the available information which
>> is included in the tar
>> archive.
>> ***** cascadia.blw: *****
>>                   250.00000000000000
>>                     0.00000000000000
>>                     0.00000000000000
>>                  -250.00000000000000
>>               -737919.06250000000000
>>               1710215.28906250000000
>>
>> ***** cascadia.hdr: *****
>> BYTEORDER      M
>> LAYOUT       BIL
>> NROWS         6435
>> NCOLS         5951
>> NBANDS        1
>> NBITS         16
>> BANDROWBYTES         11902
>> TOTALROWBYTES        11902
>> BANDGAPBYTES         0
>>
>> ***** cascadia.prj *****
>> Projection    LAMBERT
>> Zunits        NO
>> Units         METERS
>> Spheroid      CLARKE1866
>> Xshift        0.0000000000
>> Yshift        0.0000000000
>> Parameters
>>   41 30  0.000 /* 1st standard parallel
>>   50 30  0.000 /* 2nd standard parallel
>> -124 30  0.000 /* central meridian
>>   38  0  0.000 /* latitude of projection's origin
>> 0.00000 /* false easting (meters)
>> 0.00000 /* false northing (meters)
>>
>> ***** cascadia.stx *****
>> 1 5147 14378 9371.3 2076.8
>>
>> ***** excerpts from README.txt *****
>> This report contains a 250-meter digital elevation
>> model (DEM) for Cascadia
>> (latitude 39N - 53N, longitude 116W - 133W), a
>> region that encompasses the
>> Cascade volcanic arc, the Cascadia subduction zone,
>> and the Juan de Fuca
>> Ridge system. The DEM is distributed as file
>> cascdem.tar.gz  (39 MB; 78MB
>> uncompressed).
>>
>> The DEM contains elevation values in integer meters,
>> at regularly-spaced
>> points in a Lambert conformal conic projection with
>> standard parallels at
>> latitudes 41.5N and 50.5N, and a central longitude
>> of 124.5W (the
>> "Cascadia" projection.).
>>
>> To ease data transfer for the widest possible range
>> of users, the DEM is
>> distributed as a BIL (Band Interleave by Line) file,
>> produced with the ARC
>> GRIDIMAGE command. For grids (the ARC term for a DEM
>> in the form of a
>> regular array of height values), such files are more
>> compact than ARC
>> export (.e00) files and USGS DEM-format files, and
>> are much faster to
>> create and import. They can also be read by many
>> applications other than
>> ARC. cascadia.bil is such a file of binary integers.
>> 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.
>>
>> To convert CASCADIA files to an ARC grid
>>
>> Assemble the cascadia.* files (.bil, .blw, .hdr,
>> prj; .stx is not
>> necessary) in one directory. Make this your
>> workspace.
>>
>>       Arc: imagegrid cascadia casc1
>>       Arc: grid
>>       Grid: casc2 = con(casc1 <> 0, casc1 - 10000)
>>       Grid: &sys cp cascadia.prj casc2/prj.adf
>>
>> If you DESCRIBE casc2 in ARC, you should get
>>
>>       Description of Grid CASC2
>>
>>       Cell Size = 250.000 Data Type: Integer
>>       Number of Rows = 6435 Number of Values = 8555
>>       Number of Columns = 5951 Attribute Data
>> (bytes) = 8
>>
>>       BOUNDARY STATISTICS
>>
>>       Xmin = -738044.062 Minimum Value =
>> -4853.000rs)
>>       0.00000
>>
>>       Xmax = 749705.938 Maximum Value = 4378.000
>>       Ymin = 101590.289 Mean = -628.692
>>       Ymax = 1710340.289 Standard Deviation =
>> 2076.818
>>
>>                            COORDINATE SYSTEM
>> DESCRIPTION
>>
>>       Projection              LAMBERT
>>       Zunits                  UNKNOWN
>>       Units                    METERS
>> Spheroid
>>       CLARKE1866
>>       Parameters:
>>       1st standard parallel
>>          41 30
>>       0.000
>>       2nd standard parallel
>>          50 30
>>       0.000
>>       central meridian
>>         -124 30
>>       0.00
>>       latitude of projection's origin
>>          38  0
>>       0.000
>>       false easting (meters)
>>       0.00000
>>       false northing (meters)
>>       0.00000
>>
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com



-- 
Dr. Torge Schuemann
School of Earth and Ocean Sciences (SEOS)
University of Victoria
Tel.: (250) 721-6177
Fax.: (250) 472-4620
Email: ts at uvic.ca
Web Page: http://biogeochemistry.uvic.ca
Mailing address (mail and courier):
P.O. Box 3050
E-Hut, Room 135c
School of Earth and Ocean Sciences, University of Victoria
Victoria, British Columbia, V8W 2Y2, Canada




More information about the grass-user mailing list