https://github.com/grantshandy/elevation
An elevation API
https://github.com/grantshandy/elevation
Last synced: about 2 months ago
JSON representation
An elevation API
- Host: GitHub
- URL: https://github.com/grantshandy/elevation
- Owner: grantshandy
- License: mit
- Created: 2021-07-18T19:39:41.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-18T22:17:36.000Z (almost 4 years ago)
- Last Synced: 2025-03-11T05:48:16.933Z (2 months ago)
- Language: Rust
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elevation
Get elevations from coordinates and names of locations.Get an elevation from coordinates:
```rust
let e = Elevation::from_coords(45.0, 100.0).await.unwrap();println!("({}, {}): {}", e.latitude, e.longitude, e.elevation);
```
```
(45, 100): 2057
```Get elevations from multiple coordinates:
```rust
let e = Elevation::from_multiple_coords(vec![[40.828, -73.9206], [41.1955, -82.424]])
.await
.unwrap();for x in e {
println!("({}, {}): {}", x.latitude, x.longitude, x.elevation);
}
```
```
(40.828, -73.9206): 12
(41.1955, -82.424): 277
```Get an elevation from the name of a location:
```rust
let e = Elevation::from_location("Seattle, Washington")
.await
.unwrap();println!("({}, {}): {}", e.latitude, e.longitude, e.elevation);
```
```
(47.6038321, -122.3300624): 77.5
```