← Marble/OSMVectorTileCreation You do not have permission to edit this page, for the following reason: The action you have requested is limited to users in one of the groups: Users, Administrators, trusted, KDEDevelopers. You can view and copy the source of this page. = OSM Vector Tiles = == Creating tiles from a pbf file == As an example we'd like to render tiles for tile level 13, 15 and 17 of San Francisco. First you need the osm.pbf file for that region. In our case we download that from: http://download.geofabrik.de/north-america/us/california.html or to be more specifically: http://download.geofabrik.de/north-america/us/california-latest.osm.pbf === Creating the tools - osmconvert and osmfilter === Now we need the tools for conversion and filtering the pbf file into tiles. In order to compile the tools you should have zlib installed on your system (e.g. via sudo apt-get install zlib1g-dev). Then run: <source lang="bash"> cd /tmp wget http://m.m.i24.cc/osmconvert.c gcc -O3 -o osmconvert osmconvert.c -lz sudo mv osmconvert /usr/local/bin and pretty much the same for osmfilter wget http://m.m.i24.cc/osmfilter.c gcc -O3 -o osmfilter osmfilter.c sudo mv osmfilter /usr/local/bin </source> if that works, running <source lang="bash"> osmconvert -h </source> and also <source lang="bash"> osmfilter -h </source> should output usage instructions. === Running the VectorTileCreator === Now our tool is needed. You need python version 2 or 3 to be installed. In a shell, go to the marble sources directory and then <source lang="bash"> cd tools/vectortilecreator </source> now running <source lang="bash"> ./vectortilecreator.py -h </source> should give usage instructions. The tile cutter tool works as follows: You call it with a region file as parameter (or several). It will generate tiles in the currenty directory unless you use the -d option: For example -d ~/.local/share/marble/maps/earth/vectorosm is what you want for local tiles. By default it will generate tiles for zoom levels 13, 15, 17. You can overwrite that using the -z switch -z 13 15. for example to exclude level 17 (which takes looong for large regions) once called, the script does the following * It parses the region file to read which file to work on and which boundaries it has * To speed things up, it then creates another file with only the given boundaries inside (e.g. if you pass california-latest.osm.pbf and work on san francisco it will create a temporary file that has only san francisco inside) * Afterwards it iterates over the zoom levels passed. For each level it calculates the tiles that are inside the boundaries. Then it calls osmconvert for each tile to generate the tile * If it also finds a file levels/$ZOOM.level it will call osmfilter afterwards * And finally the result is zipped Return to Marble/OSMVectorTileCreation. Retrieved from "https://techbase.kde.org/Marble/OSMVectorTileCreation"