This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
Mathematica Import/Export Format

USGSDEM (.dem)

USGS ASCII DEM files.
Standard format for the distribution of terrain elevation data for the United States.
United States Geological Survey (USGS) standard.
DEM is an acronym for Digital Elevation Model.
ASCII format.
Typically distributed as .zip or .gz compressed file.
The .dem file extension is often omitted.
Common variants are 1-degree and 7.5-minute-degree DEMs.
1-degree DEMs cover 1-by-1-degree blocks at a 3-arc-second grid spacing and 1201-by-1201 raster size.
The 1-degree USGS DEM format is occasionally referred to as 1:250,000 scale DEM.
7.5-minute DEMs cover 7.5-by-7.5-minute blocks at a 30-meter grid spacing and correspond to the USGS 1:24,000 and 1:25,000 scale topographic quadrangle map series.
The raster coordinates used for 7.5-minute DEM files are referenced in the Universal Transverse Mercator (UTM) projection, resulting in irregular raster dimensions.
Elevations are given in meters relative to the National Geodetic Vertical Datum of 1929 (NGVD) for the continental United States and relative to the local mean sea level in Hawaii.
  • Import supports 1-degree and 7.5-minute USGS ASCII DEM files.
  • Import["file.dem"] imports a USGS ASCII DEM file and renders it as a topographic map.
  • Import["file.dem", elem] imports the specified element from a USGS ASCII DEM.
  • Import["file.dem", {elem, suba, subb, ...}] imports a subelement.
  • Import["file.dem", {{elem1, elem2, ...}}] imports multiple elements.
  • The import format can be specified with Import["file", "USGSDEM"] or Import["file", {"USGSDEM", elem, ...}].
  • See the reference pages for full general information on Import.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties and settings
  • Import elements:
"Data"array of terrain elevation values
"Graphics"DEM file rendered as ReliefPlot
  • Import by default uses "Graphics" for the DEM format.
  • Metadata elements:
"Dimensions"size of the elevation data array
"ElevationRange"range of elevation coordinates, given in meters
"ElevationResolution"resolution of elevation values, given in meters
"SpatialRange"range of geographic coordinates, given in decimal degrees
"SpatialResolution"grid spacing in arc seconds
  • Import["file.dem", "ElevationRange"]gives the range {zmin, zmax}of elevation values in units of meters.
  • Import["file.dem", "SpatialRange"]gives the bounding coordinates of the geographic region covered by the file as an expression of the form {{latmin, latmax}, {longmin, longmax}}.
  • General rendering options:
BoxRatiosAutomaticeffective 3D bounding box ratios
ColorFunction"Topographic"how to determine the color of surfaces
DataRangeAutomaticthe range of latitude and longitude values to assume for the data
DataReversedFalsewhether to reverse the order of rows
ImageSizeAutomaticthe overall size of the image
LightingAngleAutomaticthe effective angle from which simulated illumination is taken to come
  • Advanced option:
"DownsamplingFactor"1integer factor by which the number of latitudinal and longitudinal data points is reduced when importing