| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Mapping Toolbox |
| Contents | Index |
| Learn more about Mapping Toolbox |
| On this page… |
|---|
Digital Terrain Elevation Data from NGA |
Nearly all published terrain elevation data is in the form of data grids. Displaying Data Grids described basic approaches to rendering surface data grids with Mapping Toolbox functions, including viewing surfaces in 3-D axes. The following sections describe some common data formats for terrain data, and how to access and prepare data sets for particular areas of interest.
The Digital Terrain Elevation Data (DTED) Model is a series of gridded elevation models with global coverage at resolutions of 1 kilometer or finer. DTEDs are products of the U. S. National Geospatial Intelligence Agency (NGA), formerly the National Imagery and Mapping Agency (NIMA), and before that, the Defense Mapping Agency (DMA). The data is provided as 1-by-1 degree tiles of elevations on geographic grids with product-dependent grid spacing. In addition to NGA's own DTEDs, terrain data from Shuttle Radar Topography Mission (SRTM), a cooperative project between NASA and NGA, are also available in DTED format, levels 1 and 2 (see below).
The lowest resolution data is the DTED Level 0, with a grid spacing of 30 arc-seconds, or about 1 kilometer. The DTED files are binary. The files have filenames with the extension dtN, where N is the level of the DTED product. You can find published specifications for DTED at the NGA web site.
NGA also provides higher resolution terrain data files. DTED Level 1 has a resolution of 3 arc-seconds, or about 100 meters, increasing to 18 arc-seconds near the poles. It was the primary source for the USGS 1:250,000 (1 degree) DEMs. Level 2 DTED files have a minimum resolution of 1 arc-second near the equator, increasing to 6 arc-seconds near the poles. DTED files are available on from several sources on CD-ROM, DVD, and on the Internet.
Note For information on locating map data for download over the Internet, see the following documentation at the MathWorks Web site: http://www.mathworks.com/support/tech-notes/2100/2101.html. |
The United States Geological Survey (USGS) has prepared terrain data grids for the U.S. suitable for use at scales between 1:24,000 and 1:250,000 and beyond. Some of this data originated from Defense Mapping Agency DTEDs. Specifications and data quality information are available for these digital elevation models (DEMs) and other U.S. National Mapping Program geodata from the USGS. USGS no longer directly distributes 1:24,000 DEMs and other large-scale geodata. U.S. DEM files in SDTS format are available from private vendors, either for a fee or at no charge, depending on the data sets involved.
The largest scale USGS DEMs are partitioned to match the USGS 1:24,000 scale map series. The grid spacing for these elevations models is 30 meters on a Universal Transverse Mercator grid. Each file covers a 7.5-minute quadrangle. (Note, however, that only a subset of paper quadrangle maps are projected with UTM, and that USGS vector geodata products might not use this coordinate system.) The map and data series is available for much of the conterminous United States, Hawaii, and Puerto Rico.
Several Mapping Toolbox functions and a GUI help you identify file names for and manage digital elevation model data for areas of interest. These tools do not retrieve data from the Internet; however, they do locate files that lie on the Mapping Toolbox path and indicate the names of data sets that you can download or order on magnetic media or CD-ROM.
Certain Mapping Toolbox utility functions can describe and import elevation data. The following table describes functions that read in data, determine what file names might exist for a given area, or return metadata for elevation grid files. These files are data products packaged by government agencies; with minor exceptions, the format used for each is unique to that data product, which is why special functions are required to read them and why their filenames and/or footprints can be known a priori.
File Type | Description | Function to Read Files | Function to Identify or Summarize Files |
|---|---|---|---|
DTED | U.S. Department of Defense Digital Terrain Elevation Data | ||
DEM | USGS 1-degree (3-arc-second resolution) digital elevation models | ||
DEM24K | USGS 1:24K (30-meter resolution) digital elevation models | N/A | |
ETOPO5 ETOPO2 | Earth Topography – 5- minute (ETOPO5) and 2-minute (ETOPO2) | N/A | |
GTOPO30 | Tiles of 30-arc-second global elevation models | ||
SATBATH | Global 2-minute (4 km) satellite topography and bathymetry data | N/A | |
SDTS DEM | Digital elevation models in U.S. SDTS format | sdtsinfo (reads metadata from catalog file) | |
TBASE | TerrainBase topography and bathymetry binary and ASCII grid files | N/A |
Note that the names of functions that identify file names are those of their respective file-reading functions appended with s. These functions determine file names for areas of interest, and have calling arguments of the form (latlim, lonlim), with which you indicate the latitude and longitude limits for an area of interest, and all return a list of filenames that provide the elevations required. The southernmost latitude and the western-most longitude must be the first numbers in latlim and lonlim, respectively.
Suppose you want to obtain elevation data for the area around Cape Cod, Massachusetts. You define your area of interest to extend from 41.1ºN to 43.9ºN latitude and from 71.9ºW to 69.1ºW longitude.
To determine which DTED files you need, use the dteds function, which returns a cell array of strings:
dteds([41.1 43.9],[-71.9 -69.1])
ans =
'\DTED\W072\N41.dt0'
'\DTED\W071\N41.dt0'
'\DTED\W070\N41.dt0'
'\DTED\W072\N42.dt0'
'\DTED\W071\N42.dt0'
'\DTED\W070\N42.dt0'
'\DTED\W072\N43.dt0'
'\DTED\W071\N43.dt0'
'\DTED\W070\N43.dt0'Note three important considerations about using DTED files:
DTED filenames reflect latitudes only and thus do not uniquely specify a data set; they must be organized within directories that specify longitudes. When you download level 0 DTEDs, the DTED directory and its subdirectories are transferred as a compressed archive that you must decompress before using.
Some files that the dteds function identifies do not exist, either because they completely cover water bodies or have never been created or released by NGA. The dted function that reads the DTEDs handles missing cells appropriately.
NGA might or might not continue to make DTED data sets available to the general public online. For information on availability of terrain data from NGA and other sources, see http://www.mathworks.com/support/tech-notes/2100/2101.html.
To determine the USGS DEM files you need, use the usgsdems function:
usgsdems([41.1 43.9],[-71.9 -69.1])
ans =
'portland-w'
'portland-e'
'bath-w'
'boston-w'
'boston-e'
'providence-w'
'providence-e'
'chatham-w'Note that, in contrast to the dteds command you executed above, there are eight rather than nine files listed to cover the 3-by-3-degree region of interest. The cell that consists entirely of ocean has no name and is thus omitted from the output cell array.
To determine the GTOPO30 files you need, use the gtopo30s function:
gtopo30s([41.1 43.9],[-71.9 -69.1])
ans =
'w100n90'Note The DTED, GTOPO30, and small-scale (low-resolution) USGS DEM grids are in latitude and longitude. Large-scale (24K) USGS DEMs grids are in UTM coordinates. The usgs24kdem function automatically unprojects the UTM grids to latitude and longitude; the stdsdemread function does not. |
For additional information, see the reference pages for dteds, usgsdems, usgs24kdem, and gtopo30s.
In this exercise, you render DTED level 0 data for a portion of Cape Cod. The 1°-by-1° file can be downloaded from NGA or purchased on CD-ROM. You read and display the elevation data at full resolution as a lighted surface to show both large- and small-scale variations in the data.
Define the area of interest and determine the file to be obtained:
latlim = [ 41.20 41.95]; lonlim = [-70.95 -70.10];
To determine which DTED files you need, use the dteds function, which returns a cell array of strings:
dteds(latlim, lonlim)
ans =
'dted\w071\n41.dt0'In this example, only one DTED file is needed, so the answer is a single string. For more information on the dteds function, see Using dteds, usgsdems, and gtopo30s to Identify DEM Files).
Unless you have a CD-ROM containing this file, download it from the source indicated in the following tech note:
http://www.mathworks.com/support/tech-notes/2100/2101.html
The original data comes as a compressed tar or zip archive that you must expand before using.
Use the dted function to create a terrain grid and a referencing vector in the workspace at full resolution. If more than one DTED file named n41.dt0 exists on the path, your working directory must be /dted/w071 in order to be sure that dted finds the correct file. If the file is not on the path, you are prompted to navigate to the n41.dt0 file by the dted function:
samplefactor = 1;
[capeterrain, caperef] = dted('n41.dt0', ...
samplefactor, latlim, lonlim);Because DTED files contain no bathymetric depths, decrease elevations of zero slightly to render them with blue when the colormap is reset:
capeterrain(capeterrain == 0) = -1;
Use usamap to construct an empty map of axes for the region defined by the latitude and longitude limits:
figure; ax = usamap(latlim,lonlim);
Read data for the region defined by the latitude and longitude limits from the usastatehi shapefile:
capecoast = shaperead('usastatehi',...
'UseGeoCoords', true,...
'BoundingBox', [lonlim' latlim']);Display coastlines on the map axes that was created with usamap:
geoshow(ax, capecoast, 'FaceColor', 'none');
At this point the map looks like this:

Render the elevations, and set the colormap accordingly:
meshm(capeterrain, caperef, size(capeterrain), capeterrain); demcmap(capeterrain)
The resulting map, shown below, is a window on Cape Cod, and illustrates the relative coarseness of DTED level 0 data.

When your region of interest extends across more than one DTED tile, the dted function concatenates the tiles into a single matrix, which can be at full resolution or a sample of every nth row and column. You can specify a single DTED file, a directory containing several files (for different latitudes along a constant longitude), or a higher level directory containing subdirectories with files for several longitude bands.
To follow this exercise, you need to acquire the necessary DTED files from the Internet as described in the following tech note
http://www.mathworks.com/support/tech-notes/2100/2101.html
or from a CD-ROM. This yields a set of directories that contain the following files:
/dted
/w070
n41.avg
n41.dt0
n41.max
n41.min
n43.avg
n43.dt0
n43.max
n43.min
/w071
n41.avg
n41.dt0
n41.max
n41.min
n42.avg
n42.dt0
n42.max
n42.min
n43.avg
n43.dt0
n43.max
n43.min
/w072
n41.avg
n41.dt0
n41.max
n41.min
n42.avg
n42.dt0
n42.max
n42.min
n43.avg
n43.dt0
n43.max
n43.min Change your working directory to the directory that includes the top-level DTED directory (which is always named dted).
Use the dted function, specifying that directory as the first argument:
latlim = [ 41.1 43.9]; lonlim = [-71.9 -69.1]; samplefactor = 5; [capetopo,caperef] = dted(pwd, samplefactor, latlim, lonlim);
The sample factor value of 5 specifies that only every fifth data cell, in both latitude and longitude, will be read from the original DTED file. You can choose a larger value to save memory and speed processing and display, at the expense of resolution and accuracy. The size of your elevation array (capetopo) will be inversely proportional to the square of the sample factor.
Note You can specify a DTED filename rather than a directory name if you are accessing only one DTED file. If the file cannot be found, a file dialog is presented for you to navigate to the file you want. See the example Mapping a Single DTED File with the DTED Function. |
As DTEDs contain no bathymetric depths, recode all zero elevations to -1, to enable water areas to be rendered properly:
capetopo(capetopo==0)=-1;
Obtain the elevation grid's latitude and longitude limits; use them to draw an outline map of the area to orient the viewer:
[latlim,lonlim] = limitm(capetopo,caperef);
figure;
ax = usamap(latlim,lonlim);
capecoast = shaperead('usastatehi',...
'UseGeoCoords', true,...
'BoundingBox', [lonlim' latlim']);
geoshow(ax,capecoast,'FaceColor','None');The map now looks like this.

Render the elevation grid with meshm, and then recolor the map with demcmap to display hypsometric colors (elevation tints):
meshm(capetopo, caperef, size(capetopo), capetopo); demcmap(capetopo)
Here is the map; note the missing tile to the right where no DTED data exists.

![]() | Making Three-Dimensional Maps | Reading Elevation Data Interactively | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |