0.1.0 |
|
---|
#21 in #locations
15KB
163 代码行
高程
从坐标和地点名称获取高程。
从坐标获取高程
let e = Elevation::from_coords(45.0, 100.0).await.unwrap();
println!("({}, {}): {}", e.latitude, e.longitude, e.elevation);
(45, 100): 2057
从多个坐标获取高程
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
从地点名称获取高程
let e = Elevation::from_location("Seattle, Washington")
.await
.unwrap();
println!("({}, {}): {}", e.latitude, e.longitude, e.elevation);
(47.6038321, -122.3300624): 77.5
依赖项
~6.5–9.5MB
~197K SLoC