prefetch_map_tiles.py downloads raster XYZ map tiles in the same layout Pyxis expects on the SD card:
tiles/{z}/{x}/{y}.png
- Uses a center point and radius in kilometers.
- Computes all map tiles that intersect that area for the selected zoom range.
- Downloads each tile as a PNG.
- Saves the files into the Pyxis-compatible
tiles/folder structure.
You must provide a tile URL template for a provider that explicitly permits bulk and offline downloads.
Do not use tile.openstreetmap.org for this script. OpenStreetMap's public tile service prohibits bulk downloading and offline prefetching under the OSM Tile Usage Policy.
Use one of these instead:
- a self-hosted tile server
- a commercial provider and plan that explicitly allows offline or bulk prefetching
The default center point comes from the coordinates shown in the provided screenshot:
- latitude:
43.978093 - longitude:
-66.143359 - radius:
200 km
Dry run:
python tools/prefetch_map_tiles.py --dry-runDownload tiles:
python tools/prefetch_map_tiles.py --url-template "https://tiles.example.com/{z}/{x}/{y}.png" --min-zoom 8 --max-zoom 14Custom area:
python tools/prefetch_map_tiles.py --url-template "https://tiles.example.com/{z}/{x}/{y}.png" --lat 44.0 --lon -66.1 --radius-km 100 --min-zoom 10 --max-zoom 15After the download finishes, copy the generated tiles/ directory to the SD card root so Pyxis can load files like:
S:tiles/14/4823/6160.png
- Existing files are skipped unless
--overwriteis used. --url-templateis required for actual downloads.- Bounding boxes that cross the antimeridian are split into two tile ranges so dateline-adjacent areas work correctly.