#coordinates #geolocation #name #locations #elevations

yanked elevation

Get elevations from coordinates and names of locations

0.1.0 Jul 18, 2021

#18 in #locations

MIT license

15KB
163 lines

elevation

Get elevations from coordinates and names of locations.

Get an elevation from coordinates:

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:

    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:

let e = Elevation::from_location("Seattle, Washington")
    .await
    .unwrap();

println!("({}, {}): {}", e.latitude, e.longitude, e.elevation);
(47.6038321, -122.3300624): 77.5

Dependencies

~8–12MB
~196K SLoC