0

I've downloaded .mbtiles files to my computer for offline maps from this link (for research and test purpose, not for commercial use that money has to be paid first):

https://data.maptiler.com/downloads/dataset/osm/#0.22/0/0

and converted it using python code from this link:

https://hackeradam.com/post/dump-mbtiles-python/

The resulted OSM XYZ formatted png map tile files are unfortunately all unsupported, missing Dimensions and Bit depth info when looking at their 'details' property. However, using the same python code for the 'countries-raster.mbtile' file from this link:

https://gitlab.com/IvanSanchez/Leaflet.TileLayer.MBTiles/-/tree/master/demo?ref_type=heads

the converted XYX png map tile images are good and can be used as local XYZ map tile images in Leaflet code to get the desired map as

http://ivansanchez.gitlab.io/Leaflet.TileLayer.MBTiles/demo/demo.html

Question: What could be wrong or different in terms of meta data format for the mbtile files downloaded from the first link ? How can I make them work ? Thanks

1 Answers1

0

With the first link you mentioned you are downloading vector tiles, not raster tiles. If you need raster tiles (png) you would either have to download those or use a software like e.g. tileserver-gl to transform the vector tiles into raster tiles.

crnm
  • 476
  • 3
  • 9
  • Thanks @crnm. You are correct. The metadata.json of the vector .mbtiles file says: "format": "pbf", while that of the raster one says: "format": "png". The raster map works, but I cannot find and download good global or North America mbtiles OSM street maps that are in raster format (only satellite ones). In addition to the tileserver-gl, are there any other tools for converting a vector mbtiles file of format pbf directly to a raster mbtiles file of format png ? I could not make the tileserver-gle work for me, unfortunately. – user3553437 Aug 15 '23 at 15:18