I'm creating an iPhone travel app that uses online as well as offline maps. For the offline maps I want to allow users to download an mbtiles file of the area they are interested in (e.g. London). The map should have information such as roads etc.. that are already found in OpenStreetmap. I'm aware of web sites such as http://metro.teczno.com/ for downloading Openstreetmap extracts. What is the easiest way to create mbtiles files of Openstreetmap extracts? Note: no map customization is needed. I've tried using TileMill, but I'm not able to see the correct map information. Most information on this says to load quite a few other tools and the instructions are not easy to follow or they don't work and since I don't need map customization, it should not really be needed. My main/preferred work environments are Windows, Mac and Ubuntu (using VirtualBox under Windows) in that order.
Thanks Tom
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.
Data Download MBTiles with OSM data for analysis are available from http://osmlab.github.io/osm-qa-tiles/ , these are provided by the Humanitarian OpenStreetMap Team and updated weekly.
From the homepage, click the setup button in the sub-menu bar and select layers. On the layers page, select the create layer button to begin creating a new layer. When creating a new layer you will want to select the MBTile layer type, give your layer a name and then select the MBTile file you just created.
These things are never really easy, but I've tried to make them as easy as possible in Maperitive. In a few days I'll be releasing a new version which supports creating MBTiles from OSM XML files. In the meantime, you can read the older tutorial which generates tiles as individual files for the web map server. Since you don't need map customization, you can skip some of the steps: http://braincrunch.tumblr.com/post/9921938947/maperitive-tutorial-a-hiking-web-map-in-ten-easy-steps
Few days ago I have written an article on my website - it's a step by step process on how to generate PNG raster mbtiles from OSM data.
I am heavy mbtiles user and few weeks ago I did manage to deploy a solution based on node.js and Mapnik. Its very fast, convenient and one line command solution.
The steps to follow are:
Download and install node.js – make sure it’s 32Bit version otherwise Mapnik will not work.
Install Python if you do not have it already.
Install Mapnik executing command in the node.js console:
npm install -g tl @mapbox/mbtiles tilelive-http
When the installation is successful you should be able to execute command: -z (min zoom level), -Z (max zoom level)
tl copy -z 0 -Z 15 -b "19.481506 49.050920 20.407791 49.319751" "http://a.tile.openstreetmap.org/{z}/{x}/{y}.png" mbtiles://./tatra.mbtiles
This will create test mbtiles file for Tatra mountains and if you are on Windows the file will be located in C:\Users{your_user_name}\ folder
Due to low reputation I am not able to include URLs or pictures, but I have documented the process over here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With