|On this page…|
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: Finding Geospatial Data.
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.
Function to Read Files
Function to Identify or Summarize Files
U.S. Department of Defense Digital Terrain Elevation Data
USGS 1-degree (3-arc-second resolution) digital elevation models
USGS 1:24K (30-meter resolution) digital elevation models
ETOPO1c, ETOPO2v2c, ETOPO2–2001, and ETOPO5
Earth Topography – 1-minute (ETOPO1c), 2-minute (ETOPO2v2c and ETOPO2–2001), and 5-minute (ETOPO5)
Tiles of 30-arc-second global elevation models
Global 2-minute (4 km) satellite topography and bathymetry data
Digital elevation models in U.S. SDTS format
sdtsinfo (reads metadata from catalog file)
TerrainBase topography and bathymetry binary and ASCII grid files
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.
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 folder and its subfolders 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 Finding Geospatial Data.
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.
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 sdtsdemread function does not.
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.
latlim = [ 41.20 41.95]; lonlim = [-70.95 -70.10];
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).
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 folder 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);
capeterrain(capeterrain == 0) = -1;
figure; ax = usamap(latlim,lonlim);
capecoast = shaperead('usastatehi',... 'UseGeoCoords', true,... 'BoundingBox', [lonlim' latlim']);
geoshow(ax, capecoast, 'FaceColor', 'none');
At this point the map looks like this:
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 folder containing several files (for different latitudes along a constant longitude), or a higher level folder containing subfolders with files for several longitude bands.
To follow this exercise, you need to acquire the necessary DTED files from the Internet, as described in Finding Geospatial Data, 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
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 folder 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.
[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.
meshm(capetopo, caperef, size(capetopo), capetopo); demcmap(capetopo)
Here is the map; note the missing tile to the right where no DTED data exists.