Skip to content

This python program takes .mbtiles files and extracts the images and places them into the correct directory structure /${z}/${x}/${y}.png that mimicks OpenStreetMap URI tile structure.

License

Notifications You must be signed in to change notification settings

aemkei/mbtilesToPngs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mbtilesToPngs

This python program takes .mbtiles files and extracts the images and places them into the correct directory structure /${z}/${x}/${y}.png that mimicks OpenStreetMap URI tile structure. This is to allow for offline use of OpenStreetMaps, and I will be using Flutter_Map along with my own images for offline maps.

Where to get .mbtiles?

OpenStreetMap says: Apart from very limited testing purposes, you should not use the tiles supplied by OpenStreetMap.org itself. OpenStreetMap is a volunteer-run non-profit body and cannot supply tiles for large-scale commercial use. Rather, you should use a third party provider that makes tiles from OSM data, or generate your own.

A Guide to generate your own

This guide will go through the steps for compiling map data, downloading a specific area, customise the map, then export to mbtile. Warning! For Mac, when you install TileMill.app, it currently fails to start. Go into TileMill > Updates Preference > check Install Developer Builds.

How to use

Make sure you have python3 install.
python3 mbtilesToPngs.py -i path_to_mbfiles

for example, I did:
python3 sqliteReader.py -i ./OSMBright.mbtiles

My map says file not found! Why are the filenames incorrect?

Read Here
And here
I've added option to convert TMS Tile Coordinates to Google/Bing/OSM Tile Coordinates. Just use -tms when running.

Links

MBTiles
Tiles

License

This project is licensed under the MIT License

Acknowledgments

Thank you © OpenStreetMap (and) contributors, ODbL for the data!
Thank you AppTreeSoftware for Flutter_Map

About

This python program takes .mbtiles files and extracts the images and places them into the correct directory structure /${z}/${x}/${y}.png that mimicks OpenStreetMap URI tile structure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%