#elevation #dem #srtm #hgt #dtm

srtm_reader

A performant DTM(srtm) reader for .hgt files

7 releases

0.5.1 Jan 26, 2025
0.5.0 Jan 25, 2025
0.4.2 Jan 25, 2025
0.3.1 Sep 26, 2024

#77 in Geospatial

Download history 15/week @ 2024-11-28 74/week @ 2024-12-05 41/week @ 2024-12-12 9/week @ 2024-12-19 5/week @ 2024-12-26 16/week @ 2025-01-02 10/week @ 2025-01-09 100/week @ 2025-01-16 472/week @ 2025-01-23 38/week @ 2025-01-30 27/week @ 2025-02-06

637 downloads per month
Used in fit2gpx

BSD-3-Clause

17KB
296 lines

SRTM/HGT reader

A performant DTM(srtm) reader for .hgt files in Rust.

Supported resolutions

  • 0.5 angle second (SRTM05) <- not sure that's how it's called

  • 1 angle second (SRTM1)

  • 3 angle second (SRTM3)

  • feel free to open an issue if you need more

Example

use srtm_reader::*;

let coord = Coord::new(13.3255424, 56.92856);
// we get the filename, that shall include the elevation data for this `coord`
let filename = coord.get_filename();
// load the srtm, .hgt file
// NOTE: to be able to load it, you'll need the actual file
let tile = srtm_reader::Tile::from_file(filename).unwrap();
// and finally, retrieve our elevation data
let elevation = tile.get(coord);

also, see cli example for a real-life one

[!NOTE] a great source of DEM data, .hgt files is Sonny's collection

Dependents

  • fit2gpx-rs
  • file an issue if yours could be listed as well

Disclaimer

this crate is a forked version of the srtm crate which hasn't been updated in 6 years, and the PR hasn't been merged either in a long time. I've needed 0.5 angle support and also some more convenience methods for fit2gpx-rs, and here we are.

No runtime deps