Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
939 views
in Technique[技术] by (71.8m points)

openstreetmap - Is there a way to generate a .mbtiles file from .osm.pbf file

I have an .osm.pbf file which I want to use to generate vector tiles with (.mbtiles).

Im currently on a windows machine utilising docker, I have tried to use the tool tilemaker (https://github.com/systemed/tilemaker) though I cannot get it to work on my files and get issues like so

" terminate called after throwing an instance of 'std::runtime_error' what(): Exception during zlib decompression: (-5) "

I was just wondering if anyone else was able to generate these tiles from said file type, if so could you provide a low level detailed guide on how you did so, as I am new to vector tiles and am getting confused within some circumstances.

For anyone interested I use this code to run the docker:

docker run tilemaker tilemaker --input=sud-latest.osm.pbf --output=sud.mbtiles

I have to put tilemaker twice as otherwise it says it cannot open the .osm.pbf otherwise

question from:https://stackoverflow.com/questions/65849406/is-there-a-way-to-generate-a-mbtiles-file-from-osm-pbf-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use ogr2ogr (see other answer here) to translate osm.pbf into geojson, and then Mapbox's tippecanoe tool to convert the geojson to mbtiles.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...