The BT (Binary Terrain) File Format

Author: Ben Discoe
Last Updated: November 3, 2001

This version is obsolete, please use the latest version.

Specification Version 1.2

BT files are expected to have a file extension of .bt

There is a file header of 256 bytes, followed by the elevation grid data.  Header fields are as follows:

Byte Offset Length Contents Description
0 10 "binterr1.2" A marker which indicates that this is a BT 1.2 file
10 4 (int) Columns Width (east-west) dimension of the height grid.
14 4 (int) Rows Height (north-south) dimension of the height grid.
18 2 (short) Data size Bytes per elevation grid point, either 2 or 4.
20 2 (short) Floating-point flag If 1, the data consists of floating point values (float), otherwise they are integers.
22 2 (short) Projection 0: Geographic
1: Universal Transverse Mercator (UTM)
24 2 (short) UTM zone Indicates the UTM zone (1-60) if the file is in UTM.  The usual convention is negative zone numbers for the southern hemisphere.
26 2 (short) Datum Indicates the Datum, see Datum Values below.
28 8 (double) Left extent The extents are specified in the coordinate space specified by the UTM flag/zone fields.  If UTM is false, they are ordinary geographic (latitude-longitude) values.
36 8 (double) Right extent  
44 8 (double) Bottom extent  
52 8 (double) Top extent  
60 2 (short) External projection 0: Projection is fully described by this header
1: Projection is specified in a external .prj file
62-255 194 unused Bytes of value 0 are used to pad the rest of the header.

The header is followed by an array of values, in column-first order, containing the elevation values themselves.  For example, for a floating-point grid of dimensions 20x10, there will a series of 10 floats representing the left-most column, followed by the next column, and so on up to 20.  The data for each row is in order of increasing coordinates (south to north.)

Elevation values are specified in meters above sea level.  Negative values for undersea elevation are allowed.

Longitude follows the standard convention of positive values east of Greenwich, negative to the west.

All numeric values (both header and data) use standard little-endian encoding.

External Projection Files

Many elevation sources, especially those for the United States, have projections which can be described by the field in the BT header (Projection, UTM Zone, Datum).  When a more complete coordinate system description is required, BT supports the specification of an external projection file.  This file should be in the same location at the BT file, with the same file name, but with the .prj file extension.  The .prj file shall contain a text description of a coordinate system, in the OpenGIS Well-Known Text (WKT) format.

If the .prj format is present:

Note that this .prj format is the same as the .prj format used by the most recent versions of ESRI software, but different from the .prj format of older ESRI software.  Developers may find it useful to use free libraries such as OGR (or indirectly, GDAL or vtdata) which provide support for easily reading, writing, and utilizing the WKT format and the projections that it can represent.

Datum Values

The Datum field should be one of the following values, which are the same as those used by the USGS Projection Library.

-2 NO_DATUM 11 HU_TZU_SHAN
-1 UNKNOWN_DATUM 12 INDIAN
0 ADINDAN 13 NAD27
1 ARC1950 14 NAD83
2 ARC1960 15 OLD_HAWAIIAN_MEAN
3 AUSTRALIAN_GEODETIC_1966 16 OMAN
4 AUSTRALIAN_GEODETIC_1984 17 ORDNANCE_SURVEY_1936
5 CAMP_AREA_ASTRO 18 PUERTO_RICO
6 CAPE 19 PULKOVO_1942
7 EUROPEAN_DATUM_1950 20 PROVISIONAL_S_AMERICAN_1956
8 EUROPEAN_DATUM_1979 21 TOKYO
9 GEODETIC_DATUM_1949 22 WGS_72
10 HONG_KONG_1963 23 WGS_84