Debian with versatiles and planetiler
6.1K
This Docker image provides a self-contained toolchain to generate OpenStreetMap based vector tiles in the Shortbread schema using Planetiler (the VersaTiles fork of Planetiler together with the Shortbread profile), then packs the result into an efficient .versatiles, .pmtiles or .mbtiles container.
It is part of the versatiles-docker project.
landcover-vectors.versatiles (merged on the fly, no extra download)osmium renumber, on by default) for faster builds and slightly smaller tiles.md5 + .sha256) written next to the outputtini enabled)Run with an attached terminal (-it) and no arguments to launch the wizard. It asks whether to render the whole planet or a sub-region, whether to inject land cover, which container format to use, and the output filename. Mount one host directory at /app/data — it holds the source cache, temp files and the results:
docker run -it --rm \
-v $(pwd)/planetiler:/app/data \
versatiles/versatiles-planetiler:latest
Only --area is required; everything else has a default:
docker run --rm \
-v $(pwd)/planetiler:/app/data \
versatiles/versatiles-planetiler:latest \
--area monaco --landcover
services:
planetiler:
image: versatiles/versatiles-planetiler:latest
environment:
AREA: planet
LANDCOVER: "1"
FORMAT: versatiles
JAVA_OPTS: -Xmx20g
volumes:
- ./planetiler:/app/data
The final file is written to ./planetiler/result/<name>.<format>.
The container chooses its mode from two signals:
| Invocation | stdin | Behavior |
|---|---|---|
docker run -it … (no args) | terminal | Interactive wizard |
docker run … --area … (args or -e) | any | Non-interactive |
docker run … (no -it, no config) | not a tty | Usage hint + exit 1 |
The terminal check ([ -t 0 ]) prevents a detached or CI run from hanging on a prompt. Use -i / INTERACTIVE=1 to force the wizard.
| Flag | Environment | Default | Description |
|---|---|---|---|
--area <planet|REGION> | AREA | (required) | planet, or a Geofabrik area name (e.g. monaco, berlin) matched against the Geofabrik index. |
--landcover | LANDCOVER=1 | off | Merge land cover into the Shortbread layers. |
--format <FMT> | FORMAT | versatiles | versatiles (brotli), pmtiles or mbtiles. |
--name <BASENAME> | OUTPUT_NAME | osm[-landcover][.<region>].<date> | Output filename; the extension is added automatically. Sub-regions include the region name. |
--xmx <SIZE> | XMX | auto (from available RAM) | JVM heap for Planetiler, e.g. 20g. See Memory below. |
--torrent | TORRENT=1 | off | For --area planet: fetch the pbf via BitTorrent. See Planet download. |
--no-renumber | RENUMBER=0 | on | Skip renumbering OSM IDs with osmium (renumbering is on by default — faster and slightly smaller tiles). |
--checksum | CHECKSUM=1 | off | Write <output>.md5 and <output>.sha256 next to the result. |
-i, --interactive | INTERACTIVE=1 | — | Force the interactive wizard. |
Flags take precedence over environment variables, which take precedence over the built-in defaults.
Naming a region:
--areais matched by name against the Geofabrik index, so use the region's own name (e.g.berlin,monaco,massachusetts) — not a path likegermany/berlin. If a name is ambiguous, add a qualifier (e.g.us georgiafor the US state).
| Variable | Default | Description |
|---|---|---|
LANDCOVER_URL | public landcover-vectors.versatiles | Land cover container to merge. |
LANGUAGES | en,fr,es,de,ar,el,it,nl,pl,pt,uk | --name_languages passed to Planetiler. |
EXPERIMENTS | all | --shortbread_experiments value. |
PLANETILER_EXTRA_FLAGS | --nodemap_type=array --storage=mmap | Extra Planetiler flags. |
JAVA_OPTS | (unset) | Extra JVM options. An explicit -Xmx here overrides --xmx/XMX. |
Planetiler does not auto-abort on low memory — it only logs a warning and continues — so plan capacity yourself.
With the default --storage=mmap --nodemap_type=array, Planetiler keeps node locations in memory-mapped files, so the JVM heap can stay modest and the dominant requirement is free RAM for the OS page cache. Rule of thumb: ≥ 0.5× the .osm.pbf size as free RAM (the whole planet is a ~70 GB pbf → 64 GB+ RAM recommended).
JVM heap (-Xmx): In a container the JVM otherwise grabs only ~25 % of the cgroup limit. This image instead derives a sensible default (~40 % of the memory available to the container, capped at 32 GB) and prints it on startup. Override it with --xmx 20g / XMX=20g, or set the full JAVA_OPTS (an explicit -Xmx there wins).
Big machines: to keep everything in RAM for maximum speed, switch storage and raise the heap:
docker run --rm \
-e PLANETILER_EXTRA_FLAGS="--storage=ram --nodemap_type=array" \
-e XMX=110g \
-v $(pwd)/planetiler:/app/data \
versatiles/versatiles-planetiler:latest --area planet
See Planetiler's PLANET.md for details.
For --area planet, Planetiler downloads the ~70 GB planet extract over HTTP by default. With --torrent (or TORRENT=1) the image instead fetches it via BitTorrent using aria2c and feeds it to Planetiler with --osm_path — usually faster and more reliable. The other sources (water polygons, Natural Earth) are still fetched by Planetiler.
docker run --rm \
-v $(pwd)/planetiler:/app/data \
versatiles/versatiles-planetiler:latest --area planet --torrent
The pbf is cached under /app/data/sources/planet-<date>.osm.pbf (resumable, reused on re-runs). Override the snapshot with PLANET_DATE=YYMMDD, or the source with PLANET_PBF_BASE. --torrent is ignored for sub-regions (those download from Geofabrik via --area).
The container runs generate_tiles.sh, which performs:
--no-renumber) Renumber the OSM input with osmium renumber so node/way IDs are dense. This shrinks Planetiler's node map (faster, less I/O) and shortens the feature IDs encoded in each tile (slightly smaller output). For the whole planet this adds time and needs RAM ≈ the pbf size, so disable it there if resources are tight.planetiler shortbread-1.1 --area=<area> into an intermediate PMTiles file (flat layout → fast sequential reads).versatiles convert. When land cover is enabled, the VPL from_merged_vector operation folds the remote land cover container's features into the Shortbread layers (range-read on demand, nothing downloaded)./app/data/result/<name>.<format>.--checksum) Checksum — write <name>.<format>.md5 and <name>.<format>.sha256 next to the result..versatiles output is compressed with brotli; .pmtiles / .mbtiles keep their default compression.
Mount one host directory at /app/data; it holds everything — the source cache (sources/), Planetiler's temp files (tmp/), the intermediate tiles and the results (result/). Keeping the cache on the host means re-runs reuse already-downloaded sources.
Rendering the whole planet is heavy: budget ~400 GB+ free disk and a few hours (see Memory for RAM). Test with a small region first, e.g. --area monaco. To put results elsewhere, set RESULT_DIR.
This image uses tini as PID 1 to correctly handle SIGINT / SIGTERM signals. You can safely interrupt the container with Ctrl-C.
Distributed under the MIT License. Project: versatiles.org
Content type
Image
Digest
sha256:e7559c55b…
Size
217.7 MB
Last updated
6 days ago
docker pull versatiles/versatiles-planetiler