Tuesday, February 21, 2006

Viewing BIL files...

You've got a BIL, but want to look at the data. Here's how:
  1. Make sure its not 7zip'd -- if it is, then unzip it. Usually you do not have to worry about this, as WW unzips them for you.
  2. Make a copy of the file, and rename it to .raw
  3. Figure out the dimensions of the file: you can do this by math or by looking at the .XML description. For instance, the SRTM30 has the following description inside C:\Program Files\NASA\World Wind 1.3\Config\Earth.xml

SamplesPerTile: 150
DataFormat: Int16
FileExtension: BIL
CompressonType: 7z

This says that each tile is 150 x 150 pixels, with 16 bit integers. To use math, just take the file size of the uncompressed BIL (e.g. 45000 bytes for SRTM30 data), then divide by 2 (2 bytes per pixel), then square root (assuming all BILs are square). (45000 / 2) ^ 0.5 = 150 pixels.

Now, choose your poison to view the BILs. For quickness, I use IrfanView:

  1. Load the .RAW file copy into Irfan View.
  2. Set the RAW Parameters:
    The image width and height are calculated in step 3 above
    The file header is 0 bytes
    The BIL is 16 bits per pixel (or different, as spec'd in the XML file)
  3. The color will give you only a rough idea, as it is using three channels to display a monochrome color.

To view it in Photoshop:

  1. Open the .RAW file in Photoshop
  2. Set the RAW Parameters:
    The image width and height are calculated in step 3 above
    The number of channels is 1
    The Depth is 16 bits per pixel (or different, as spec'd in the XML file)
    The Byte order is IBM.
    The file header is 0 bytes
  3. Pull up the levels adjustment (Ctrl-L)
    Move the gamma (center grey) tab to see the intermediate height values.

More information:

http://www.worldwindcentral.com/wiki/Add-on:Colored_SRTM_elevation_data_add-on
http://forum.worldwind.arc.nasa.gov/lofiversion/index.php?t5508.html
http://support.intergraph.com/Geospatial/Downloads/Tools.asp?ID=70&SORT=Title


Note: the referenced TIF2BIL tool from Integraph above requires zifl00.dll -- which comes with INGR's I/RasC and ImageViewer. It also may be available in their raster utilities (thanks Mazop!). Also:from Pangloss: actually it's bil2tif not tif2bil; ISRUStandalone contains zirfl01.dll not zirfl00.dll.

0 Comments:

Post a Comment

<< Home