USGS DEM


The USGS DEM standard is a geospatial file format developed by the United States Geological Survey for storing a raster-based digital elevation model. It is an open standard, and is used throughout the world. It has been superseded by the USGS's own SDTS format but the format remains popular due to large numbers of legacy files, self-containment, relatively simple field structure and broad, mature software support.

DEM Level

A USGS DEM can be classified into one of four levels of quality. This is due to the multiple methods of data collection, and certainty in the data.
DEM levelDEM seriesProduction processComments
Level 17.5-minute
30-minute
Created by autocorrelation or manual profiling from aerial photographsMay be derived from a wide variety of sources using any of a number of USGS approved techniques and instrumentation
Level 2All seriesCreated from digital line graph contours or equivalent, from any USGS map series up to 1:100000 scaleThe accuracy and data spacing are intended to support computer applications that analyze hypsographic features to a level of detail similar to manual interpolations of information from printed source maps
Level 37.5-minuteCreated from DLG that have vertically integrated with all categories of hypsography, hydrography, ridge line, break line, drain files, and all vertical and horizontal control networkRequires a system of logic to interpret the data
Level 4All seriesCreated from electronic imaging sensor systems, either active or passive The process includes all additional post-processing required to bring the DEM grid to its final form

Format Structure

The USGS DEM format is a self-contained set of ASCII-encoded 1024-byte blocks that fall into three record categories called A, B, and C. There is no cross-platform ambiguity since line ending control codes are not used, and all data including numbers is represented in readable text form. There is no known binary analogue of the format, although it is common practice to compress the files with gzip.
Floating-point numbers are encoded using Fortran scientific notation, so C/C++ programs need to swap the "D" exponent-indicating character with "E" when parsing.
A record fields hold the origin, type, summary statistics and the measurement systems used by the profiles. The A record appears once as the file's header, the C record also appears once as the trailer, and multiple B records comprise the elevation data. A and C records each fit within one block, but a single B record typically requires multiple blocks. When such block-spanning occurs, data are shifted to start cleanly on each block boundary. A records also come in "old" and "new" flavors, because the USGS added several fields to the A record. One of the key items is the quadrangle, which is a set of four terrestrial coordinates describing the four-sided polygon enclosing the area of interest.
Starting ColEnding ColDescription
0134Descriptive Name of the represented area
150155?
156161?
162167UTM Zone number
529534Unit of resolution of ground grid
535540Unit of resolution Elevation
546569Easting of the South West corner
570593Northing of the South West corner
594617Easting of the North West corner
618641Northing of the North West corner
642665Easting of the North East corner
666689Northing of the North East corner
690713Easting of the South East corner
714737Northing of the South East corner
738761Minimum elevation found in this file
762786Maximum elevation found in this file
816827Resolution per grid cell East – West
828839Resolution per grid cell North – South
858863Number of columns

B records are a variable-length longitudinal column of raster elevations that start at a specified location. They are some multiple of 1024 bytes long and contain a small header summarizing the profile. The elevations are contiguous; breaks or other discontinuities are expressed using "void" elevations of value -32767. Each elevation is described as a six-character readable integer occupying a fixed location in a block. The profile header only appears in the first block, so subsequent blocks hold more elevation values. When reading the DEM file from first byte to last, one reads the profiles as columns from west to east. The elevations within a profile run from south to north. The variable-location and variable-length nature of profiles stems mainly from the use of the UTM ground reference system. Since measurements within UTM employ fixed distances, the quadrangle must slightly distort to map such locations onto the spherical Earth. This distortion usually manifests as a rotated square, hence the elevation columns near the east and west edges start more northward and contain fewer samples.
C records contain root-mean squared error quality control data, using ten six-character integer fields.