Author: Ben Discoe
Last Updated: September 11, 2007
In 1997, i began working with elevation grids, and discovered that there was no standard format for representing them. The USGS used several formats, primarily DEM, but they were only suited to distribution of fixed-size standard elevation products. In addition to being inflexible, DEM was very inefficient, consuming much disk space and therefore slow for file IO.
The BT format was designed to be simple, compact, easy to read and write, and flexible in regards to size and coordinate representation.
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.3" A marker which indicates that this is a BT 1.3 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 signed integers. 22 2 (short) Horizontal units 0: Degrees
2: Feet (international foot = .3048 meters)
3: Feet (U.S. survey foot = 1200/3937 meters)
24 2 (short) UTM zone Indicates the UTM zone (1-60) if the file is in UTM. Negative zone numbers are used 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 (projection) of the file. For example, if the file is using UTM, then the extents are in UTM coordinates. 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 4 (float) Scale (vertical units) Vertical units in meters, usually 1.0. The value 0.0 should be interpreted as 1.0 to allow for backward compatibility. 66-255 190 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 column is in order of increasing coordinates (south to north.)
Elevation values are specified in meters above sea level. Negative values (such as for bathymetry) elevation are allowed. To get actual elevation in meters, the grid data values should be multiplied by the scale (vertical units). The grid data value -32768 indicates the absence of data at a given point.
Longitude follows the standard convention of positive values east of Greenwich, negative to the west.
All numeric values (both header and data) use little-endian encoding (i.e. Intel, not Motorola).
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 not present:
- the External Projection field should be set to 0
- the Horizontal units field should be interpreted as follows: 0 = Geographic, 1 = UTM.
This allows programs which don't care about full projection description to ignore the .prj and still make use of the BT elevation data.
If the .prj format is present:
- the External Projection field should be set to 1
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 OGR indirectly, such as through GDAL or vtdata) which provide support for easily reading, writing, and utilizing the WKT format and the projections that it can represent.
The Datum field should be an EPSG Geodetic Datum Code, which are in the range of 6001 to 6904. If you are unfamiliar with these and do not care about Datum, you can simply use the value "6326" which is the WGS84 Datum.
The simpler USGS Datum Codes are also supported for as a backward-compatibility with older files, but all new files should use the more complete EPSG Codes.
The BT format was created as part of the Virtual Terrain Project ( http://vterrain.org/ ) which includes an open-source library and software tools to read and write BT as well as reading most other known elevation formats (DEM, DTED, etc.)
Any questions regarding BT can be sent to firstname.lastname@example.org
Version 1.0 (1997)
Version 1.1 (July 2001) added support for Datum and improved the extents to be double-precision.
Version 1.2 (Nov. 2001) added support external projection files.
Version 1.3 (June 2003) added support for elevation scale (vertical units) and horizontal units of feet.
Small edit (August 2007) clarified the value to use for points without data.
Some sample BT files are located here.
In addition to the VTP libraries and applications, much other software supports the BT format.
- AutoDEM tool for creating DEMs writes BT.
- DEM2RWX reads BT and can convert it to the RWX format.
- Geoscape3d (commercial, for Windows) can import from BT, although it largely ignores extents and projection information.
- Global Mapper, the swiss-army-knife of geodata, supports BT among its countless formats.
- Grome tool for artificial terrain creation reads BT.
- L3DT freeware terrain generator writes BT.
- LandSerf is a freeware Java app for terrain visualization, which reads BT.
- Leveller is a commercial yet inexpensive height editor with full BT support (via GDAL).
- T2 Texture Generation program reads BT.
- Terraform is an open-source Linux height field generation and manipulation program.
- World Construction Set and Visual Nature Studio from 3DNature can save terraffected terrain in the BT format.
- XTerra is a open source terrain renderer which uses BT as its native format.