TopoScript .BIL File Format
Q: What is the BIL file format read by TAP with TopoScript?
A: TAP 4.5 and later, which includes the TopoScript engine for reading elevation data files, can read the .BIL format using the script for USGS National Elevation Dataset (NED) data files.
(To index and read the .BIL files, be sure the NED script is indexed in your TAP system.)
The .BIL format TAP is looking for includes four files. The files must have identical file names with the specified file extensions. (This description is from the USGS BIL format documentation for Digital Elevation Model, or DEM, files.)
Data File (.BIL)
The elevation values in a simple binary raster. There are no header or trailer bytes imbedded in the image. The data are stored in row major (all the data for row 1, followed by all the data for row 2, etc.).
Header File (.HDR)
The DEM header file is an ASCII text file containing the size and coordinate information for the DEM. The following keywords are used in the header file:
BYTEORDER |
byte order in which image pixel values are stored M = Motorola byte order (most significant byte first) I = Intel byte order (least significant byte first) |
LAYOUT |
organization of the bands in the DEM BIL = band interleaved by line (the DEM is a single band image) |
NROWS |
number of rows in the image |
NCOLS |
number of columns in the image |
NBANDS |
number of spectral bands for the image (must be 1) |
NBITS |
number of bits per pixel (32, 16, or 8) |
BANDROWBYTES |
number of bytes per band per row (number of columns times the number of bytes per pixel, determined from NBITS above; number of bytes = NBITS/8) |
TOTALROWBYTES |
total number of bytes of data per row (number of columns times the number of bytes per pixel. For the single band image, TOTALROWBYTES will always equal BANDROWBYTES |
BANDGAPBYTES |
number of bytes between bands; must be 0 for single band image |
Example header file:
BYTEORDER M
LAYOUT BIL
NROWS 6000
NCOLS 4800
NBANDS 1
NBITS 32
BANDROWBYTES 9600
TOTALROWBYTES 9600
BANDGAPBYTES 0
World File (.BLW)
The world file is an ASCII text file containing coordinate information. It is used for georeferencing of image data. The world data file does not use keywords. Each entry must be included as shown in the example, in the order given.
The world file contains (in this order):
X dimension of a pixel in decimal degrees
Rotation term (always zero)
Rotation term (always zero)
Negative Y dimension of a pixel in decimal degrees
Longitude of the center of the upper-left pixel
Latitude of the center of the upper-left pixel
Example World File
0.0002777777778
0.0000000000000
0.0000000000000
-0.000277777778
-99.995833333333
39.9958333333333
Projection File (.PRJ)
The projection information file is an ASCII text file that describes the projection of the DEM and source map image.
Example Projection File
PROJECTION GEOGRAPHIC
DATUM NAD83
ZUNITS METERS
UNITS DD
SPHEROID GRS1980
XSHIFT 0.0000000000
YSHIFT 0.0000000000
![]() ![]() ![]() ![]() |
Copyright 2003 by SoftWright LLC