A C++ program for use with the Osmium library to extract data from OSM PBF files necessary to render low zoom (< z8) tiles of openstreetmap-carto. The extract is written to a OSM PBF file.
The following tags are included.
Relations:
boundary=administrative
andtype=boundary
andadmin_level=2|3|4
boundary=nature_reserve
boundary=national_park
natural=glacier
natural=water
Ways:
highway=motorway
highway=trunk
railway=rail
natural=glacier
natural=water
boundary=administrative
andtype=boundary
andadmin_level=2|3|4
boundary=nature_reserve
boundary=national_park
route=ferry
Nodes:
place=city
place=town
place=village
place=hamlet
Make sure that you have setup your development environment. There are various tutorials out there how to do that. Install dependencies that are required by Osmium, namely zlib and Boost iterator. Checkout a copy of Osmium from GitHub and place it within this repository or any other location you want.
Compile with:
g++ -Ipath/to/libosmium/include -std=c++11 -o osm-carto-lowzoom osm-carto-lowzoom.cpp -pthread -lz
If you want to include debug symbols add the -g
option.
Run the program with ./osm-carto-lowzoom input.osm.pbf output.osm.pbf
.
Available under the MIT License. See LICENSE.txt for details.