READHGT: Import/download NASA SRTM data files (.HGT)

버전 (68.5 KB) 작성자: François Beauducel
Imports or download SRTM worldwide digital elevation model data files.
다운로드 수: 7.8K
업데이트 날짜: 2021/8/18

라이선스 보기

This function imports .HGT "height" binary data files from NASA SRTM global digital elevation model of Earth land, corresponding to 1x1 degree tiles of 3-arc seconds resolution (SRTM3, around 90 m) and 1-arc second (SRTM1, around 30 m), and returns coordinates vectors latitude and longitude, and a matrix of elevation values.
The function includes also an automatic download of data from the USGS SRTM webserver, so indicating latitude and longitude is sufficient to get the data and instant map plot anywhere in the World.
Few examples:
plots a map of Seattle and surrounding volcanoes,
X = readhgt(48,2,'plot');
plots a map of Paris (France) and returns downloaded SRTM data in structure X.
Type "doc readhgt" for syntax, options, other examples and use.

인용 양식

François Beauducel (2024). READHGT: Import/download NASA SRTM data files (.HGT) (, MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2011b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보 with codes included (!)

change USGS web site to mirror for SRTM3 tiles

new option 'login' to specify user and password at NASA/EarthDATA center (free registration needed) in order to download SRTM1 tiles (in addition to 'srtm1' option).

- replaces unzip with webread function, a workaround to automatic download failure

- 'decim' option applies also to output grid(s).

adds new option 'wget' to workaround an issue with older releases (< 2014b), when downloading tiles automatically. This option works only for Linux and MacOSX. See documentation for further explanation.

MAJOR UPDATE: changed URL protocol to access USGS SRTM3 files. This is to avoid "offshore tiles" message when downloading new files. An alternative is to always use the URL option:

updates URL for world-wide SRTM1 tiles. Still unofficial...

- fix issue when merging SRTM1 tiles

- fix a problem when SRTM1 tiles are not found.

- fix in AREA syntax

- new options 'outdir' and 'url' (replacing former syntax)
- improves documentation

- new syntax readhgt(AREA)
- now can download SRTM1 30-m resolution tiles worldwide with option 'srtm1'

- 'merge' option is now default. Use new 'tiles' option to plot/download individual tiles when lat/lon are vectors
- LON argument is now automatically normalized to -180/+179°
- dem.m companion function update

improve backward compatibility (strjoin)

corrects an issue with tiles above latitude 54N (thanks to Greg).

- bug correction in case of READHGT(FILENAME)
- rewriting of help
- minor corrections

- new 'interp' option that fills the novalue gaps
- new 'crop' option to select rectangle part of tile(s)
- updated DEM companion function

minor update

- improves coding
- upgrades companion dem.m function

Bug correction when "dem.m" function is not detected.

- minor modifications
- now uses DEM function (included in ZIP file) for basemap axis and legends

- adds possibility to download multiple tiles with merge option
- improved graphic output

- adjust aspect ratio with latitude
- add minimal basemap axis ticks

- now reads also SRTM1 USA territory (1 arc-second resolution) data files.
- minor bug corrections.