A rewrite of satellite-imagery-downloader by andolg in Rust
Find a file
2026-06-13 19:35:05 +07:00
src Add parallel downloading 2025-12-06 18:24:19 +07:00
.gitignore Add progress bar 2025-02-19 10:12:50 +07:00
Cargo.toml Update and add the tip 2026-06-13 19:33:52 +07:00
LICENSE Initial rewrite 2025-02-19 09:37:28 +07:00
README.md Fix image url 2026-06-13 19:35:05 +07:00

Tip

Hosted on Forgejo and mirrored on GitLab for people without local accounts. Issues and MRs are welcome everywhere. Visit https://lovie.dev/code for more info.

Satellite Imagery Downloader

A rewrite of the original program by andolg in Rust.

A Rust program and library that downloads a rectangular map region by its geographic coordinates and saves it as a PNG image. It works by downloading map tiles at a given zoom level and cropping border tiles to fit the region.

This program should work with any raster map that uses Web Mercator, including Google Maps, Esri and OpenStreetMap.

© 2023 Google

Usage

Please note that downloading map tiles without using the API may violate the map service's terms of use.

Install:

cargo install satellite_imagery_downloader

Use as a library:

cargo add satellite_imagery_downloader

On the first run, the program will create a preferences file. Run the program again. Now you will be asked to enter the coordinates and zoom level in the command line.

  • Enter the coordinates of the top-left and bottom-right corners of a rectangular region as decimal degrees (latitude before longitude) with any separator you want, e.g. 40.612123, -73.895381.

  • Enter the zoom level at which you want to get the image. This article explains how it affects the scale and resolution.

Google Maps satellite imagery will be used by default.

Preferences file

"channels" is not supported, all images downloaded are RGBA.

  • "url" is the URL template that the program will use to download map tiles.
  • "tile_size" is the size of a single tile in pixels. The default is 256.
  • "dir" is the directory where your images will be saved. If the directory doesn't exist, it will be created automatically.
  • "headers" are the headers that the program will use to make HTTP requests.

Optional:

preferences.json can also be used to specify the coordinates and zoom level. If you leave one of the following fields empty, you will be asked to use the command line instead.

  • "tl" and "br" are the coordinates of the top-left and bottom-right corners of a rectangular region.
  • "zoom" is the zoom level.

If you encounter any problems with the program, feel free to open an issue.

Tile URL

Here are some tile URLs that you can use:

If you need to download an image from a different map service, you can try to get the tile URL using your browser. Open the map, then open developer tools (Ctrl+Shift+I) and go to the Network panel. When you refresh the page or scroll the map, it logs the resources that are being downloaded. Find a tile, copy the URL and replace its coordinate and zoom values with {x}, {y} and {z}.


Examples

Images in full resolution: https://mega.nz/folder/7sxTwALS#n2bFCYk9JsiU7nbVQH-ntw

© 2022 Google

© 2022 Google

© 2022 Google

© 2022 Google

© OpenStreetMap