Main Content

usgsdem

(Removed) Read USGS 1-degree (3-arc-second) Digital Elevation Model

usgsdem has been removed. Use readgeoraster instead. For more information, see Compatibility Considerations.

Syntax

[Z,refvec] = usgsdem(filename,scalefactor)
[Z,refvec] = usgsdem(filename,scalefactor,latlim,lonlim)

Description

[Z,refvec] = usgsdem(filename,scalefactor) reads the specified file and returns the data in a regular data grid along with referencing vector refvec, a 1-by-3 vector having elements [cells/degree north-latitude west-longitude] with latitude and longitude limits specified in degrees. The data can be read at full resolution (scalefactor = 1), or can be downsampled by the scalefactor. A scalefactor of 3 returns every third point, giving 1/3 of the full resolution.

[Z,refvec] = usgsdem(filename,scalefactor,latlim,lonlim) reads data within the latitude and longitude limits. These limits are two-element vectors with the minimum and maximum values specified in units of degrees.

Background

The U.S. Geological Survey has made available a set of digital elevation maps of 1-degree quadrangles covering the contiguous United States, Hawaii, and limited portions of Alaska. The data is on a regular grid with a spacing of 30 arc-seconds (or about 100-meter resolution). 1-degree DEMs are also referred to as 3-arc-second or 1:250,000 scale DEM data.

The data is derived from the U.S. Defense Mapping Agency's DTED-1 digital elevation model, which itself was derived from cartographic and photographic sources. The cartographic sources were maps from the 7.5-minute through 1-degree series (1:24,000 scale through 1:250,000 scale).

Examples

Read every fifth point in the file containing part of Rhode Island and Cape Cod.

[Z,refvec] = usgsdem('providence-e',5);

Tips

The grid for the digital elevation maps is based on the 1984 World Geodetic System (WGS84). Older DEMs were based on WGS72. Elevations are in meters relative to National Geodetic Vertical Datum of 1929 (NGVD 29) in the continental U.S. and local mean sea level in Hawaii.

The absolute horizontal accuracy of the DEMs is 130 meters, while the absolute vertical accuracy is ±30 meters. The relative horizontal and vertical accuracy is not specified, but is probably much better than the absolute accuracy.

These DEMs have a grid spacing of 3 arc-seconds in both the latitude and longitude directions. The exception is DEM data in Alaska, where latitudes between 50 and 70 degrees North have grid spacings of 6 arc-seconds, and latitudes greater than 70 degrees North have grid spacings of 9 arc-seconds.

Statistical data in the files is not returned.

You can obtain the data files from the U.S. Geological Survey and from commercial vendors. Other agencies have made some local area data available online.

Version History

Introduced before R2006a

expand all

R2023b: Removed

The usgsdem function, which returns a referencing vector, has been removed. Instead, use the readgeoraster function, which returns a geographic raster reference object. Reference objects have several advantages over referencing vectors.

  • Unlike referencing vectors, reference objects have properties that document the size of the associated raster, its geographic limits, and the direction of its rows and columns. For examples of reference object properties, see GeographicCellsReference and GeographicPostingsReference.

  • You can manipulate the limits of rasters associated with reference objects using the geocrop function.

  • You can manipulate the size and resolution of rasters associated with reference objects using the georesize function.

  • Most functions that accept referencing vectors as input also accept reference objects.

This table shows some typical usages of usgsdem and how to update your code to use readgeoraster instead. The readgeoraster function requires you to specify a file extension.

RemovedRecommended
[Z,refvec] = usgsdem(filename,scalefactor);
[Z,R] = readgeoraster(filename);
[Z,R] = georesize(Z,R,1/scalefactor);
[Z,refvec] = usgsdem(filename,scalefactor,latlim,lonlim);
[Z,R] = readgeoraster(filename);
[Z,R] = geocrop(Z,R,latlim,lonlim);
[Z,R] = georesize(Z,R,1/scalefactor);

The readgeoraster function returns data using the native data type embedded in the file. Return a different data type by specifying the 'OutputType' name-value pair. For example, use [Z,R] = readgeoraster(filename,'OutputType','double').

The readgeoraster function does not automatically replace missing data with NaN values. If your data set uses large negative numbers to indicate missing data, you can replace them with NaN values using the standardizeMissing function.

[Z,R] = readgeoraster('MtWashington-ft.grd');
info = georasterinfo('MtWashington-ft.grd');
m = info.MissingDataIndicator;
Z = standardizeMissing(Z,m);