1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! A performant [srtm](https://www.earthdata.nasa.gov/sensors/srtm) reader for `.hgt` files.
//!
//! # Usage
//!
//! ```rust
//! use srtm_reader::{Tile, Coord};
//! use std::path::PathBuf;
//!
//! // the actual elevation of Veli Brig, 263m
//! const TRUE_ELEV: i16 = 263;
//! // the coordinates of Veli Brig, actual elevation: 263m
//! let coord = Coord::new(44.4480403, 15.0733053);
//! // we get the filename, that shall include the elevation data for this `coord`
//! let filename = coord.get_filename();
//! // in this case, the filename will be:
//! assert_eq!(filename, "N44E015.hgt");
//! // load the srtm tile: .hgt file
//! let tile = Tile::from_file(filename).unwrap();
//! // and finally, retrieve our elevation for Veli Brig
//! let elevation = tile.get(coord).unwrap();
//! // test with a ± 5m accuracy
//! assert!((TRUE_ELEV - 5..TRUE_ELEV + 5).contains(&elevation));
//! println!("Veli Brig:\n\t- coordinates: {coord:?}\n\t- elevation\n\t\t- actual: {TRUE_ELEV}m\n\t\t- calculated: {elevation}m");
//! ```
pub use Coord;
pub use Resolution;
pub use Tile;