Automated daily conversion of OpenStreetMap data to compressed MBTiles format for major countries using GitHub Actions.
This repository automatically downloads and converts OSM data from Geofabrik to MBTiles format using Planetiler, then compresses them with zstd for efficient distribution.
- 🇰🇷 South Korea
- 🇯🇵 Japan
- 🇩🇪 Germany
- 🇫🇷 France
- 🇬🇧 United Kingdom
- 🇮🇹 Italy
- 🇪🇸 Spain
- 🇨🇦 Canada
- 🇦🇺 Australia
- Min Zoom: 0
- Max Zoom: Varies by country for optimal file size:
- 13: South Korea
- 12: Japan, Germany, France, UK, Italy, Spain
- 11: Canada, Australia
- Boundary Layer: Enabled
- Simplify Tolerance: 0.1
- Compression: zstd level 19 (maximum compression)
- Format: MBTiles (.mbtiles.zst)
- South Korea: 6GB
- Most countries: 7GB (Japan, Germany, France, UK, Italy, Spain, Canada, Australia)
The workflow runs daily at 12:00 UTC (automatically triggered by GitHub Actions).
You can also manually trigger the workflow:
- Go to the Actions tab
- Select "CI"
- Click "Run workflow"
project/
├── .github/
│ └── workflows/
│ └── ci.yml
├── data/
│ ├── sources/
│ │ ├── natural_earth_vector.sqlite.zip
│ │ ├── water-polygons-split-3857.zip
│ │ └── lake_centerline.shp.zip
│ └── {country}-{YYMMDD}.mbtiles.zst
└── README.md
- Download: Fetches latest OSM data from Geofabrik
- Convert: Uses Planetiler to convert OSM.PBF → MBTiles
- Compress: Compresses MBTiles with zstd (level 19)
- Upload: Stores compressed files as artifacts
- Release: Creates GitHub release with all compressed files (only if files changed)
Each release includes two types of files per country:
{country}-{YYMMDD}.mbtiles.zst
Example: south-korea-260214.mbtiles.zst
{country}.mbtiles.zst
Example: south-korea.mbtiles.zst
💡 Use Case:
- Dated files: For reproducibility and archival purposes
- Country-only files: For always getting the latest data without changing URLs
Go to the Releases page and download either:
- Dated version:
country-YYMMDD.mbtiles.zst - Latest version:
country.mbtiles.zst
Download the .mbtiles.zst file and decompress it:
# Install zstd if needed
# Ubuntu/Debian: sudo apt-get install zstd
# macOS: brew install zstd
# Windows: https://github.com/facebook/zstd/releases
# Decompress dated version
zstd -d south-korea-260214.mbtiles.zst
# Or decompress latest version
zstd -d south-korea.mbtiles.zst# Download and decompress latest version
wget -qO- https://github.com/PedalLog/MapFiles/releases/latest/download/south-korea.mbtiles.zst | zstd -d > south-korea.mbtiles
# Download and decompress specific dated version
wget -qO- https://github.com/PedalLog/MapFiles/releases/download/mbtiles-260214/south-korea-{YYMMDD}.mbtiles.zst | zstd -d > south-korea.mbtilesIf you want to convert files manually:
- Java 21+ (Download)
- zstd compression tool
- Downloaded
planetiler.jar(Latest Release) - Downloaded OSM data from Geofabrik
# Download required data sources first
mkdir -p data/sources
wget -O data/sources/natural_earth_vector.sqlite.zip \
https://naciscdn.org/naturalearth/packages/natural_earth_vector.sqlite.zip
wget -O data/sources/water-polygons-split-3857.zip \
https://osmdata.openstreetmap.de/download/water-polygons-split-3857.zip
wget -O data/sources/lake_centerline.shp.zip \
https://github.com/acalcutt/osm-lakelines/releases/download/v12/lake_centerline.shp.zip
# Convert OSM to MBTiles (adjust maxzoom based on country size)
java -Xmx16g -jar planetiler.jar \
--osm-path={country}-{date}.osm.pbf \
--output={country}-{date}.mbtiles \
--minzoom=0 \
--maxzoom=13 \
--boundary-layer=true \
--simplify-tolerance=0.1 \
--natural-earth-path=data/sources/natural_earth_vector.sqlite.zip \
--water-polygons-path=data/sources/water-polygons-split-3857.zip \
--force
# Compress with zstd (maximum compression)
zstd -19 --threads=0 {country}-{date}.mbtiles -o {country}-{date}.mbtiles.zst| Region | RAM | Time |
|---|---|---|
| Small city | 4–8 GB | 1–5 min |
| Country (ex: South Korea) | 8–16 GB | 5–30 min |
| Planet | 64+ GB | 4–12 hours |
This project uses:
- Planetiler: Apache 2.0 License
- OSM Data: ODbL License
- Natural Earth: Public Domain
- Geofabrik Downloads
- Planetiler GitHub
- MBTiles Specification
- OpenStreetMap
- Natural Earth Data
- zstd Compression
- The workflow uses caching to avoid re-downloading OSM data if already available
- Files are only uploaded/released if they have changed (SHA256 hash comparison)
- Each release includes both dated and latest versions of files
- Artifacts are retained for 30 days
- Each country is processed in parallel for faster execution
- Failed conversions don't stop other countries from being processed
- zstd compression achieves approximately 50-70% size reduction
- Latest version files (
country.mbtiles.zst) always point to the most recent data for stable download URLs