GMaps Image Fetcher
Simple tool to download and stitch together image tiles from Google Maps via the Static-Maps API
How it works
- Give the tool two sets of latitudes and longitudes for the north-west and south-east of the area you wish to download the imagery from
- The tool calculates how many individual image tiles it needs to get from Google's Static-Maps API and begins to download them
- All image tiles are stitched together and a preview showed onscreen
- The image is saved to a file in your chosen format (PNG, JPG, or BMP)
Installation
Prerequisites
- A GOOGLE_MAPS_API_KEY is required as per the T&Cs of Google's Static-Maps API (plenty of tutorials online showing you how to generate this, Google it)
- Please ensure to enable the Static Maps API also in your account
Install from PyPI
pip install gmaps-image-fetcher
Install from GitHub
pip install git+https://github.com/joseph-holland/gmaps-image-fetcher.git
Running
-
Set your GOOGLE_MAPS_API_KEY environment variable
Windows
set GOOGLE_MAPS_API_KEY=AIzaS.............
Linux/macOS
export GOOGLE_MAPS_API_KEY=AIzaS.............
-
Run the tool and give it the NW lat/lon and SE lat/lon as well as a zoom level (1= world, 20=buildings)
gmaps-image-fetcher -nw 53.369745 -6.348743 -se 53.348326 -6.296656 -z 16
-
The tool will calculate how many image tiles it will need to retrieve and prompt if you wish to continue
Retrieve 15 image tiles from Google static-maps API Do you want to continue y/n: y
-
It will then download the image tiles, stitch them together, show the image onscreen and save to the local directory
Command-line Options
| Option | Description |
|---|---|
-nw, --northwest |
Northwest latitude/longitude coordinates |
-se, --southeast |
Southeast latitude/longitude coordinates |
-z, --zoom |
Zoom level from 1 (world) to 20+ (buildings), default is 18 |
-sc, --scale |
Scale factor for Google Maps API (1 or 2), default is 1, 2 is for high resolution |
-f, --format |
Output image format (png, jpg, bmp), default is png |
--delay |
Delay between API requests in seconds, default is 0.5; used in case of Google API rate limits |
-d, --debug |
Enable debug output |
-l, --logfile |
Logfile to write |
--version |
Show the version number and exit |
Examples
Save a high-resolution image with scale factor 2:
gmaps-image-fetcher -nw 53.369745 -6.348743 -se 53.348326 -6.296656 -z 16 -sc 2
Save as JPEG format for smaller file size:
gmaps-image-fetcher -nw 53.369745 -6.348743 -se 53.348326 -6.296656 -z 16 -f jpg
Increase delay between API calls to avoid rate limits:
gmaps-image-fetcher -nw 53.369745 -6.348743 -se 53.348326 -6.296656 -z 16 --delay 1.0
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Metadata
Release files for gmaps-image-fetcher 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gmaps_image_fetcher-1.0.0.tar.gz | 18.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gmaps_image_fetcher-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.1 kB
Release files / gmaps_image_fetcher-1.0.0.tar.gz
| Download URL | gmaps_image_fetcher-1.0.0.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80c050581f02df2de3092299c35ff1c7684680d9ded35b1ece80735c9611dbca
|
|
BLAKE2b-256 checksum How to use checksums |
aa1cc1ec0d368ab742809baa836cd7a51d4f5b07b0d4f4820fba69e867404812
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Release files / gmaps_image_fetcher-1.0.0-py3-none-any.whl
| Download URL | gmaps_image_fetcher-1.0.0-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f6009fc02ef3fa60f5c4d5a1927e8f6d98d3c4624fb5a5f244c2da3395a500d
|
|
BLAKE2b-256 checksum How to use checksums |
a38cf6d3bd43b5c9e29bce65c357a593bd4c9c4dc35f8363c303e188781634a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|