This is a specialized version of Planetiler for visualizing bicycle infrastructure.
All core functionalities are derived from the original Planetiler project. This repository includes additional profiles and examples specifically optimized for extracting and displaying bicycle-related data from OpenStreetMap.
Planetiler is a tool for generating Vector Tiles from geographic data sources like OpenStreetMap. It is fast and memory-efficient, allowing large areas to be processed on a single machine.
The generated vector tiles are output as MBTiles (SQLite) files and can be served using tools like TileServer GL or Martin.
Upstream Project: github.com/onthegomap/planetiler
- Java 21+ (see CONTRIBUTING.md)
- At least 1GB of free SSD space plus 5-10x the size of the
.osm.pbffile - At least 0.5x as much free RAM as the size of the
.osm.pbffile
This repository is used as a Git submodule in other projects:
# Initialize submodule for the first time
git submodule update --init --recursive
# Update submodule to the latest version
git submodule update --remote --mergeFirst, compile the project using Maven:
mvn clean package --file planetiler-examples/standalone.pom.xmlThis creates an executable JAR file at:
planetiler-examples/target/planetiler-examples-HEAD-with-deps.jar
Download a .osm.pbf file for your desired area:
- Geofabrik Downloads: https://download.geofabrik.de/
- e.g., Germany: https://download.geofabrik.de/europe/germany-latest.osm.pbf
- e.g., Europe: https://download.geofabrik.de/europe-latest.osm.pbf
- Smaller Extracts: https://extract.bbbike.org/
Save the .osm.pbf file in a suitable directory (e.g., osm_data/).
The following profiles are available:
Extracts all marked bike routes from OSM:
java -Xmx25g -cp planetiler-examples/target/planetiler-examples-HEAD-with-deps.jar \
com.onthegomap.planetiler.examples.BikeRouteOverlay \
--osm_path=osm_data/germany-latest.osm.pbf \
--mbtiles=output/bikeroutes.mbtilesExtracts parking, charging stations, repair stations, and speed limits:
java -Xmx25g -cp planetiler-examples/target/planetiler-examples-HEAD-with-deps.jar \
com.onthegomap.planetiler.cycling.BicycleSecondaryInfra \
--osm_path=osm_data/germany-latest.osm.pbf \
--mbtiles=output/bike-secondary-infra.mbtilesExtracts cycle highways and bicycle streets:
java -Xmx25g -cp planetiler-examples/target/planetiler-examples-HEAD-with-deps.jar \
com.onthegomap.planetiler.cycling.BikeCyclehighways \
--osm_path=osm_data/germany-latest.osm.pbf \
--mbtiles=output/cyclehighways.mbtilesExtracts paths by surface type (asphalt vs. gravel):
java -Xmx25g -cp planetiler-examples/target/planetiler-examples-HEAD-with-deps.jar \
com.onthegomap.planetiler.cycling.BikeSurfaceInfra \
--osm_path=osm_data/germany-latest.osm.pbf \
--mbtiles=output/bike-surface.mbtiles--osm_path: Path to the.osm.pbfinput file--mbtiles: Path to the.mbtilesoutput file (optional, default value is set)-Xmx25g: RAM limit for Java (adjust based on available RAM and OSM file size)
Nach dem Erzeugen der MBTiles kannst du sie direkt lokal im Browser anschauen:
Variante 1: tileserver-gl-light (empfohlen, schnell & einfach)
npm install -g tileserver-gl-light
tileserver-gl-light output/bikeroutes.mbtilesVariante 2: Docker (keine Installation nötig)
docker run --rm -it -v "$(pwd)/output":/data -p 8080:8080 maptiler/tileserver-gl -p 8080Im Browser öffnen:
Du kannst jede erzeugte MBTiles-Datei (z.B. output/bike-surface.mbtiles) einfach anstelle von bikeroutes.mbtiles angeben.
- Layer:
bikeroutes - Source Tags:
route=bicycle,network(international/national/regional/local) - Output: Lines for bike routes with network classification
- Zoom Levels: 5-14
- Layer:
parking,charging,repairstation,compressed_air,maxspeed - Source Tags:
amenity=bicycle_parkingamenity=charging_station+bicycle=yesamenity=bicycle_repair_stationamenity=compressed_airmaxspeed >= 80(excluding motorways)
- Output: Points and polygons for infrastructure
- Zoom Levels: 5-14
- Layer:
cyclehighways - Source Tags:
cycle_highway=yes/proposed,cyclestreet=yes,bicycle_road=yes - Output: Lines for cycle highways and bicycle streets
- Zoom Levels: 5-14
- Layer:
surface - Source Tags:
surface=asphalt/paved/concrete→surface_category=asphaltsurface=gravel/fine_gravel/pebblestone/unpaved/earth/dirt/ground/grass→surface_category=gravel
- Filter: Excludes
bicycle=no,access=no,motorway - Output: Lines categorized by surface type
- Zoom Levels: 8-14
This project is based on Planetiler and uses the same license.
The data comes from OpenStreetMap and is subject to the ODbL license.
- Planetiler - The underlying tool
- OpenStreetMap Contributors - The data source
- PMTiles optimized tile storage format
- Apache Parquet to support reading geoparquet files in Java (with dependencies minimized by parquet-floor)
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.