A digital elevation model (DEM) is a digital representation of ground surface topography or terrain. It is also widely known as a digital terrain model (DTM). A DEM can be represented as a raster (a grid of squares) or as a triangular irregular network. DEMs are commonly built using remote sensing techniques, but they may also be built from land surveying. DEMs are used often in geographic information systems, and are the most common basis for digitally-produced relief maps.
Digital elevation models may be prepared in a number of ways, but they are frequently obtained by remote sensing rather than direct survey. One powerful technique for generating digital elevation models is interferometric synthetic aperture radar: two passes of a radar satellite (such as RADARSAT-1), or a single pass if the satellite is equipped with two antennas (like the SRTM instrumentation), suffice to generate a digital elevation map tens of kilometers on a side with a resolution of around ten meters. Alternatively, other kinds of stereoscopic pairs can be employed using the digital image correlation method, where two optical images acquired with different angles taken from the same pass of an airplane or an Earth Observation Satellite (such as the HRS instrument of SPOT5 or the VNIR band of ASTER). 
In 1986, the SPOT 1 satellite provided the first usable elevation data for a sizeable portion of the planet's landmass, using two-passes stereoscopic correlation. Later, further data were provided by the European Remote-Sensing Satellite (ERS) using the same method, the Shuttle Radar Topography Mission using single-pass SAR and the ASTER instrumentation on the Terra satellite using double-pass stereo pairs. 
Older methods of generating DEMs often involve interpolating digital contour maps that may have been produced by direct survey of the land surface; this method is still used in mountain areas, where interferometry is not always satisfactory. Note that the contour line data or any other sampled elevation datasets (by GPS or ground survey) are not DEMs, but may be considered digital terrain models. A DEM implies that elevation is available continuously at each location in the study area.
The quality of a DEM is a measure of how accurate elevation is at each pixel (absolute accuracy) and how accurately is the morphology presented (relative accuracy). Several factors play an important role for quality of DEM-derived products:
Common uses of DEMs include:
A digital elevation model - also sometimes called a digital terrain model (DTM) - generally refers to a representation of the Earth's surface (or subset of this), excluding features such as vegetation, buildings, bridges, etc. The DEM often comprises much of the raw dataset, which may have been acquired through techniques such as photogrammetry, LiDAR, IfSAR, land surveying, etc. A digital surface model (DSM) on the other hand includes buildings, vegetation, and roads, as well as natural terrain features. The DEM provides a so-called bare-earth model, devoid of landscape features. While a DSM may be useful for landscape modeling, city modeling and visualization applications, a DEM is often required for flood or drainage modeling, land-use studies, geological applications, and much more.
A free DEM of the whole world called GTOPO30 (30 arcsecond resolution, approx. 1 km) is available, but its quality is variable and in some areas it is very poor. A much higher quality DEM from the Advanced Spaceborne Thermal Emission and Reflection Radiometer (ASTER) instrument of the Terra satellite is also freely available for 99% of the globe, and represents elevation at a 30 meter resolution. A similarly high resolution was previously only available for the United States territory under the Shuttle Radar Topography Mission (SRTM) data, while most of the rest of the planet was only covered in a 3 arc-second resolution (around 90 meters). The limitation with the GTOPO30 and SRTM datasets is that they cover continental landmasses only, and SRTM does not cover the polar regions and has mountain and desert no data (void) areas. SRTM data, being derived from radar, represents the elevation of the first-reflected surface — quite often tree tops. So, the data are not necessarily representative of the ground surface, but the top of whatever is first encountered by the radar. Submarine elevation (known as bathymetry) data is generated using ship-mounted depth soundings. The SRTM30Plus dataset (used in NASA World Wind) attempts to combine GTOPO30, SRTM and bathymetric data to produce a truly global elevation model.
The most usual grid (raster) is between 50 and 500 meters. In gravimetry e.g., the primary grid may be 50 m, but is switched to 100 or 500 meters in distances of about 5 or 10 kilometers.
Many national mapping agencies produce their own DEMs, often of a higher resolution and quality, but frequently these have to be purchased, and the cost is usually prohibitive to all except public authorities and large corporations. DEMs are often a product of National LIDAR Dataset programs.
Free DEMs are also available for Mars: the MEGDR, or Mission Experiment Gridded Data Record, from the Mars Global Surveyor's Mars Orbiter Laser Altimeter (MOLA) instrument; and NASA's Mars Digital Terrain Model (DTM).
The US Geological Survey produces the National Elevation Dataset, a seamless DEM for the contiguous United States, Hawaii and Puerto Rico based on 7.5' topographic mapping. As of the beginning of 2006, this replaces the earlier DEM tiled format (one DEM per USGS topographic map).