Planetiler (pla·nuh·tai·lr, formerly named “Flatmap”) is a tool that generates Vector Tiles from geographic data sources like OpenStreetMap. Planetiler aims to be fast and memory-efficient so that you can build a map of the world in a few hours on a single machine without any external tools or database.
Vector tiles contain raw point, line, and polygon geometries that clients like MapLibre can use to render custom maps in the browser, native apps, or on a server. Planetiler packages tiles into an MBTiles (sqlite) file that can be served using tools like TileServer GL or even queried directly from the browser. See awesome-vector-tiles for more projects that work with data in this format.
Planetiler works by mapping input elements to vector tile features, flattening them into a big list, then sorting by tile ID to group into tiles. See ARCHITECTURE.md for more details or this blog post for more of the backstory.
See the live demo of vector tiles created by Planetiler and hosted by the OpenStreetMap Americana Project.
Style © OpenMapTiles
· Data © OpenStreetMap contributors
To generate a map of an area using the basemap profile, you will need:
.osm.pbf file.osm.pbf file sizeUsing Java, download planetiler.jar from
the latest release
and run it:
wget https://github.com/onthegomap/planetiler/releases/latest/download/planetiler.jar
java -Xmx1g -jar planetiler.jar --download --area=monaco
Or using Docker:
docker run -e JAVA_TOOL_OPTIONS="-Xmx1g" -v "$(pwd)/data":/data ghcr.io/onthegomap/planetiler:latest --download --area=monaco
:warning: This starts off by downloading about 1GB of data sources required by the basemap profile including ~750MB for ocean polygons and ~240MB for Natural Earth Data.
Using Node.js:
npm install -g tileserver-gl-light
tileserver-gl-light --mbtiles data/output.mbtiles
Or using Docker:
docker run --rm -it -v "$(pwd)/data":/data -p 8080:8080 maptiler/tileserver-gl -p 8080
Then open http://localhost:8080 to view tiles.
Some common arguments:
--download downloads input sources automatically and --only-download exits after downloading--area=monaco downloads a .osm.pbf extract from Geofabrik--osm-path=path/to/file.osm.pbf points Planetiler at an existing OSM extract on disk-Xmx1g controls how much RAM to give the JVM (recommended: 0.5x the input .osm.pbf file size to leave room for
memory-mapped files)--force overwrites the output file--help shows all of the options and exitsSee PLANET.md.
See the planetiler-examples project.
Some example runtimes for the Basemap OpenMapTiles-compatible profile (excluding downloading resources):
| Input | Version | Machine | Time | mbtiles size | Logs |
|---|---|---|---|---|---|
| s3://osm-pds/2022/planet-220530.osm.pbf (69GB) | 0.5.0 | c2d-standard-112 (112cpu/448GB) | 37m cpu:48h5m gc:3m45s avg:76.9 | 79GB | logs |
| s3://osm-pds/2022/planet-220530.osm.pbf (69GB) | 0.5.0 | c6gd.16xlarge (64cpu/128GB) | 53m cpu:41h58m avg:47.1 | 79GB | logs, VisualVM Profile |
| s3://osm-pds/2022/planet-220530.osm.pbf (69GB) | 0.5.0 | c6gd.8xlarge (32cpu/64GB) | 1h27m cpu:37h55m avg:26.1 | 79GB | logs |
| s3://osm-pds/2022/planet-220530.osm.pbf (69GB) | 0.5.0 | c6gd.4xlarge (16cpu/32GB) | 2h38m cpu:34h3m avg:12.9 | 79GB | logs |
| s3://osm-pds/2021/planet-211011.osm.pbf (65GB) | 0.1.0 | DO 16cpu 128GB | 3h9m cpu:42h1m avg:13.3 | 99GB | logs, VisualVM Profile |
| Daylight Distribution v1.6 with ML buildings and admin boundaries (67GB) | 0.1.0 | DO 16cpu 128GB | 3h13m cpu:43h40m avg:13.5 | 101GB | logs |
Merging nearby buildings at z13 is very expensive, when run with --building-merge-z13=false:
| Input | Version | Machine | Time | mbtiles size | Logs |
|---|---|---|---|---|---|
| s3://osm-pds/2022/planet-220530.osm.pbf (69GB) | 0.5.0 | c2d-standard-112 (112cpu/448GB) | 26m cpu:27h47m avg:63.9 | 79GB | logs |
| s3://osm-pds/2022/planet-220530.osm.pbf (69GB) | 0.5.0 | c6gd.16xlarge (64cpu/128GB) | 39m cpu:27h4m avg:42.1 | 79GB | logs, VisualVM Profile |
| s3://osm-pds/2021/planet-220214.osm.pbf (67GB) | 0.3.0 | r6g.16xlarge (64cpu/512GB) with ramdisk and write to EFS | 1h1m cpu:24h33m avg:24.3 | 104GB | logs |
| s3://osm-pds/2021/planet-211011.osm.pbf (65GB) | 0.1.0 | Linode 50cpu 128GB | 1h9m cpu:24h36m avg:21.2 | 97GB | logs, VisualVM Profile |
Some other tools that generate vector tiles from OpenStreetMap data:
Some companies that generate and host tiles for you:
If you want to host tiles yourself but have someone else generate them for you, those companies also offer plans to download regularly-updated tilesets.
--pushgateway=http://user:password@ip argument (and a grafana dashboard for viewing)geofabrik:australia shortcut as a source URL.osm.pbf snapshots, there is no way to incorporate real-time updates.Planetiler can be used as a maven-style dependency in a Java project using the settings below:
Add this dependency to your java project:
<dependency>
<groupId>com.onthegomap.planetiler</groupId>
<artifactId>planetiler-core</artifactId>
<version>0.5.0</version>
</dependency>
Set up your repositories block as follows:
mavenCentral()
maven {
url "https://repo.osgeo.org/repository/release/"
}
Set up your dependencies block as follows:
implementation 'com.onthegomap.planetiler:planetiler-core:<version>'
Pull requests are welcome! See CONTRIBUTING.md for details.
For general questions, check out the #planetiler channel on OSM-US Slack (get an invite here), or start a GitHub discussion.
Found a bug or have a feature request? Open a GitHub issue to report.
This is a side project, so support is limited. If you have the time and ability, feel free to open a pull request to fix issues or implement new features.
Planetiler is made possible by these awesome open source projects:
See NOTICE.md for a full list and license details.
Planetiler was created by Michael Barry for future use generating custom basemaps or overlays for On The Go Map.
Planetiler source code is licensed under the Apache 2.0 License, so it can be used and modified in commercial or other open source projects according to the license guidelines.
Maps built using planetiler do not require any special attribution, but the data or schema used might. Any maps generated from OpenStreetMap data must visibly credit OpenStreetMap contributors. Any map generated with the profile based on OpenMapTiles or a derivative must visibly credit OpenMapTiles as well.