Sources of Terrain Data

Digital Terrain Elevation Data from NGA

Nearly all published terrain elevation data is in the form of data grids. Types of Data Grids and Raster Display Functions 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.

Digital Elevation Model Files from USGS

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.

Determining What Elevation Data Exists for a Region

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

dted

dteds

DEM

USGS 1-degree (3-arc-second resolution) digital elevation models

usgsdem

usgsdems

DEM24K

USGS 1:24K (30-meter resolution) digital elevation models

usgs24kdem

N/A

ETOPO1c, ETOPO2v2c, ETOPO2–2001, and ETOPO5

Earth Topography – 1-minute (ETOPO1c), 2-minute (ETOPO2v2c and ETOPO2–2001), and 5-minute (ETOPO5)

etopo

N/A

GTOPO30

Tiles of 30-arc-second global elevation models

gtopo30

gtopo30s

SATBATH

Global 2-minute (4 km) satellite topography and bathymetry data

satbath

N/A

SDTS DEM

Digital elevation models in U.S. SDTS format

sdtsdemread

sdtsinfo (reads metadata from catalog file)

TBASE

TerrainBase topography and bathymetry binary and ASCII grid files

tbase

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.

Using dteds, usgsdems, and gtopo30s to Identify DEM Files

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.

  1. 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:

    1. 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.

    2. 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.

    3. 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.

  2. 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.

  3. 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 sdtsdemread function does not.

For additional information, see the reference pages for dteds, usgsdems, usgs24kdem, and gtopo30s.

Mapping a Single DTED File with the DTED Function

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.

  1. Define the area of interest and determine the file to be obtained:

    latlim = [ 41.20  41.95];
    lonlim = [-70.95 -70.10];
  2. 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).

  3. Unless you have a CD-ROM containing this file, download it from the source indicated in the following tech note:

    Finding Geospatial Data

    The original data comes as a compressed tar or zip archive that you must expand before using.

  4. 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);
  5. 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;
  6. Use usamap to construct an empty map of axes for the region defined by the latitude and longitude limits:

    figure;
    ax = usamap(latlim,lonlim);
  7. Read data for the region defined by the latitude and longitude limits from the usastatehi shapefile:

    capecoast = shaperead('usastatehi',...
        'UseGeoCoords', true,...
        'BoundingBox', [lonlim' latlim']);
  8. Display coastlines on the map axes that was created with usamap:

    geoshow(ax, capecoast, 'FaceColor', 'none');

    At this point the map looks like this:

  9. 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.

Mapping Multiple DTED Files with the DTED Function

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.

  1. 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 
  2. Change your working folder to the folder that includes the top-level DTED folder (which is always named dted).

  3. Use the dted function, specifying that folder 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 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.

  4. As DTEDs contain no bathymetric depths, recode all zero elevations to -1, to enable water areas to be rendered properly:

    capetopo(capetopo==0)=-1;
  5. 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.

  6. 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.

Was this topic helpful?