During GIS project delivery, situations with weak or no network connectivity are frequently encountered. Typically, we need to manually download map tiles from various providers. Currently, there are numerous map downloaders available on the market, both free and paid. Upon closer thought, this process isn't particularly complex; it essentially breaks down into three steps: defining the area of interest, downloading all tiles within that area, and exporting. Therefore, while working on a project, the author searched for a simple, small-scale downloader and ultimately found one on GitHub: OfflineMapDownloader.

Project Introduction

Original Project Repository:

https://github.com/0015/OfflineMapDownloader

After testing, the author identified several significant issues, primarily in the following three areas:

  1. It only supports OpenStreetMap and ArcGIS Online.
  2. It does not support downloading tiles for regions in China.
  3. The downloaded .mbtiles files cannot be opened in QGIS.

The issue with China regions was particularly critical, rendering the tool unusable for the author. Consequently, the author made some simple fixes and created a new version. The author's version repository:

https://github.com/sailor103/OfflineMapDownloader

This version primarily addresses the three aforementioned problems. It can now correctly export maps for Chinese regions and supports opening the files in QGIS, as shown below:

Usage Instructions

Before use, please ensure your computer has a Python3 environment installed (version 3.7 or above is recommended). No additional GIS base libraries need to be configured, as dependent packages will be installed automatically. Enter the following commands:

git clone https://github.com/sailor103/OfflineMapDownloader.git
cd OfflineMapDownloader

Install the project dependencies. To avoid interference between projects, it is still recommended to create a new virtual environment using tools like conda. For reference: "[GIS Tutorial] Conda Basic Usage Workflow" (https://malagis.com/gis-tutorial-conda-base-work-flow.html)

pip install -r requirements.txt

Finally, run the following command to start the application:

python app.py

After successful startup, open your browser and navigate to http://127.0.0.1:5000 to access the visual download interface!

Test Results

Manually draw an area on the map, then select the desired download format, zoom levels, and tile source.

Click download. After downloading, the required format will be exported. The resulting file can be opened using QGIS.

To resolve the issue of being unable to download satellite tiles for Chinese regions, the author has added a Bing Maps tile source. Initially, Tianditu (Map World) was considered, but its data becomes unclear at higher zoom levels, so it was excluded.

Summary

Originally, the author simply wanted to find a small-scale tile downloader that required no complex configuration, no API keys, and offered a visual interface. Unexpectedly, this still led down the rabbit hole of modifying code. For now, it serves its purpose adequately. Others are welcome to modify the code to add additional features. Please refrain from submitting issues or requesting stars, as the author does not have time for further development.

Finally, please note: This tool is provided solely for learning purposes and is limited to personal, educational, or experimental use. Commercial application or large-scale automated downloading is strictly prohibited.