Mapping Toolbox | ![]() ![]() |
Read USGS 7.5 minute 1:24,000 (30 m) Digital Elevation Model files
Syntax
[latgrat,longrat,mat] = usgs24kdem [latgrat,longrat,mat] = usgs24kdem(filename
) [latgrat,longrat,mat] = usgs24kdem(filename
,scalefactor) [latgrat,longrat,mat] = usgs24kdem(filename
,scalefactor, latlim,lonlim) [latgrat,longrat,mat] = usgs24kdem(filename
,scalefactor, latlim,lonlim,gsize) [latgrat,longrat,mat,A,B] = usgs24kdem(...)
Background
The U. S. Geological Survey has created a series of digital elevation models based on their paper 1:24,000 scale maps. The grid spacing for these elevations models is 30 meters on a Universal Transverse Mercator grid. Each file covers a 7.5 minute quadrangle. The map and data series is available for much of the contiguous United States, Hawaii, and Puerto Rico. The data has been released in a number of formats. This function reads the data in the `standard' file format.
Description
[latgrat,longrat,mat] = usgs24kdem reads a USGS 1:24,000 Digital Elevation Map (DEM) file in standard format. The file is selected interactively. The entire file is read and subsampled by a factor of 5, and returned as a general matrix map.
[latgrat,longrat,mat] = usgs24kdem(filename
) specifies the name of the DEM file.
[latgrat,longrat,mat] = usgs24kdem(filename
,scalefactor) subsamples the file by the scalefactor
. If omitted, the default is 5, which returns every 5th point.
[latgrat,longrat,mat] = usgs24kdem(filename
,scalefactor,latlim,lonlim) returns data for the requested geographic area. The area is specified as two-element vectors in units of degrees. The data will extend somewhat outside the requested area. If omitted, the entire area covered by the DEM file is returned.
[latgrat,longrat,mat] = usgs24kdem(filename
,scalefactor,latlim,lonlim, gsize) also controls the graticule size. gsize
is a two-element vector specifying the number of rows and columns in the latitude and longitude matrices. If omitted, a graticule the same size as the map is returned.
[latgrat,longrat,mat,A,B] = usgs24kdem(...) also returns the contents of the A
and B
records of the DEM file. The A
record is a header to the file containing descriptions of the data. The B
record is the raw profile data from which the matrix map is constructed.
Examples
Get the 1:24,000 DEM for south San Francisco, available from the Bay Area Regional Database at <http://bard.wr.usgs.gov/htmldir/dem_html/dem-sf.html>. The URL for the San Francisco South DEM is <http://bard.wr.usgs.gov/bard/dem/dems24k/sanfrancisco/sanfranciscos.dem>. Be sure you save to a file rather than opening in a window.
Read the entire file, taking every second point.
[latgrat,longrat,mat] = usgs24kdem('sanfranciscos.dem',2); whos Name Size Bytes Class latgrat 232x186 345216 double array longrat 232x186 345216 double array mat 232x186 345216 double array
Read the DEM at full resolution, limiting the area to the San Bruno mountains. These limits can be defined using inputm on a display of the above data. Also return the header record.
axesm mercator surfm(latgrat,longrat,mat,,mat-max(mat(:))) [latlim,lonlim] = inputm(2); [latgrat,longrat,mat,A] = usgs24kdem('sanfranciscos.dem',1,... latlim,lonlim); whos Name Size Bytes Class A 1x1 4740 struct array latgrat 162x202 261792 double array latlim 1x2 16 double array longrat 162x202 261792 double array lonlim 1x2 16 double array mat 162x202 261792 double array A A = Quadranglename: 'SAN FRANCISCO SOUTH, CA BIG BASIN DEM' TextualInfo: 'WMC CTOG' Filler: '' ProcessCode: '' Filler2: '' SectionalIndicator: '' MCoriginCode: '' DEMlevelCode: 2 ElevationPatternCode: 'regular' PlanimetricReferenceSystemCode: 'UTM' Zone: 10 ProjectionParameters: [15x1 double] HorizontalUnits: 'meters' ElevationUnits: 'feet' NsidesToBoundingBox: 4 BoundingBox: [ 8x1 double] MinMaxElevations: [ 2x1 double] RotationAngle: 0 AccuracyCode: 'accuracy information in record C' XYZresolutions: [ 3x1 double] NrowsCcols: [ 2x1 double] MaxPcontourInt: '' SourceMaxCintUnits: '' SmallestPrimary: '' SourceMinCintUnits: '' DataSourceDate: '' DataInspRevDate: '' InspRevFlag: '' DataValidationFlag: '' SuspectVoidFlag: '' VerticalDatum: '' HorizontalDatum: '' DataEdition: '' PercentVoid: ''
Remarks
This function reads USGS DEM files stored in the UTM projection. Use usgsdem
for data stored in geographic grids.
The number of points in a file will vary with the geographic location. Unlike the USGS DEM products that use an equal angle grid, the UTM projection grid DEMs cannot simply be concatenated to cover larger areas. There may be data gaps between DEMs.
The data files can be obtained by contacting the U.S. Geological Survey. Other agencies have made some of the data available online. Source for data for the San Francisco Bay area are
<ftp://bard.wr.usgs.gov/bard/dem/dems24k/>.
Extensive documentation on the data format and standards are available from
<http://mapping.usgs.gov/www/ti/DEM/standards_dem.html>
<ftp://mapping.usgs.gov/pub/ti/DEM/demguide/>.
The DEM files are ASCII files, and can be transferred as text. Line-ending conversion is not necessarily required.
See Also
usgsdem |
USGS 1-Degree (3-arc-sec resolution) digital elevation data |
dted |
U. S. Department of Defense Digital Terrain Elevation Data (DTED) data |
gtopo30 |
30-Arc-Sec global digital elevation data |
tbase |
TerrainBase Global 5-Min digital terrain data |
etopo5 |
ETOPO5 Global 5-Min digital terrain data |
![]() | tigerp | usgsdem | ![]() |