-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.rs
29 lines (23 loc) · 1005 Bytes
/
main.rs
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
use geo::polygon;
use open_street_maps::tile_fetcher;
use snapr::{SnaprBuilder, TileFetcher};
fn main() -> Result<(), anyhow::Error> {
let snapr = SnaprBuilder::new()
.with_tile_fetcher(TileFetcher::individual(tile_fetcher))
.with_tile_size(256)
.with_zoom(15)
.build()?;
let polygon = geo::polygon![
// Chimney Rock, Nebraska
// https://www.openstreetmap.org/search?lat=41.703811459356196&lon=-103.34835922605679
(x: 41.703811459356196, y: -103.34835922605679),
// Chimney Rock Cemetery, Nebraska
// https://www.openstreetmap.org/search?lat=41.702909695820175&lon=-103.33250120288363
(x: 41.69996628239992, y: -103.34170814251178),
// Chimney Rock Museum, Nebraska
// https://www.openstreetmap.org/search?lat=41.702909695820175&lon=-103.33250120288363
(x: 41.702909695820175, y: -103.33250120288363),
];
snapr.snapshot_from_geometry(polygon)?.save("example.png")?;
Ok(())
}