#openstreetmap #tile #osm #street #open #map #filesystem

bin+lib osm-tile-downloader

Download tiles from an OpenStreetMap tileserver to the file system

7 releases

0.2.5 May 26, 2020
0.2.4 May 10, 2020
0.2.1 Apr 25, 2020
0.2.0 Jan 5, 2020
0.1.0 Oct 9, 2019

#6 in #street

23 downloads per month

MIT license

22KB
409 lines

osm-tile-downloader

Download OpenStreetMap-tiles to your disk en-masse.

Use with absolute caution. Downloading tiles en-masse can hog down a tile server easily. I am not responsible for any damage this tool may cause.

Usage

This tool is available on crates.io and can be installed via cargo install osm-tile-downloader. It features a helpful CLI you can access via -h / --help.

It is also available as a library.

CLI Example

osm-tile-downloader \
  --north 50.811 \
  --east 6.1649 \
  --south 50.7492 \
  --west 6.031 \
  --url https://\{s\}.tile.openstreetmap.de/\{z\}/\{x\}/\{y\}.png \
  --output ./tiles \
  --rate 10

Library Example

use osm_tile_downloader::{fetch, BoundingBox, Config};
use std::path::Path;

let config = Config {
    bounding_box: BoundingBox::new_deg(50.811, 6.1649, 50.7492, 6.031),
    fetch_rate: 10,
    output_folder: Path::new("./tiles"),
    request_retries_amount: 3,
    url: "https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png",
    timeout_secs: 30,
    zoom_level: 10,
};

fetch(config).await.expect("failed fetching tiles");

License: MIT

Dependencies

~12–24MB
~367K SLoC