NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum


I want to do a really simple thing:

  1. download city data from
  2. do some magic (where I don't have to write bazillion stylesheets by hand) to convert it to MBTiles
  3. run it on a mobile app offline

The problem is that I can't find a way to sensibly convert the data. I've tried Tilemill (trust me I really tried), but it just doesn't do what I expect. It doesn't really care if I add layers, most of the time it just errors or does nothing for 20 minutes, and even when I get it working the best I could do is this

I don't want anything custom, I don't want to create my own layer thingies with custom graphics, or customize how the map works. All I want is to take the default look of OSM, slice a region and stick it into a MBTiles format. I also tried osm2pgsql according to Tilemill guide, but Tilemill crashed saying that there is some invalid data.

I've read tons of documentation but everything just refers to one more complicated tool than another and 1000 ways to customize things. I tried mapnik and mb-util (which tells me file is encrypted or is not a database for every single file format I've tried), but I couldn't find a simple way to do this.

Could someone please point me to a resource or explain a simple way to take .osm and shove it into a .MBTiles?

asked 02 Aug '13, 11:51

darthdeus's gravatar image

accept rate: 0%

edited 09 Jan '16, 14:46

aseerel4c26's gravatar image

aseerel4c26 ♦

Did you take a look at the various implementations?

(02 Aug '13, 15:58) scai ♦

There is no simple way, except "simply" paying someone to do the complicated stuff for you and send you the MBTiles file you're after. Most of the things that one would usually say in response to your question (osm2pgsql, tilemill etc) you seem to have tried already and failed. It seems to work for other people; maybe you should go to a TileMill support forum and post the exact error messages you received there.

If you are on Windows or Linux - and not on iOS - then another relatively simple option is Maperitive where you can load an OSM file and export to tiles with a few commands; after that you'd still have to run some utility (e.g. mbutil) to convert the raw tiles to MBTiles format.

permanent link

answered 02 Aug '13, 12:18

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
accept rate: 23%

I don't understand why this should be something complicated. I'm not asking to customize anything, I just need to convert one file format to another, no changes, no nothing, just a simple export.

(02 Aug '13, 12:30) darthdeus

Conversions between file formats are rarely simple.

(02 Aug '13, 15:56) scai ♦

Look at this as an initial-days stage in a multi-year technology development process. At one time it was incredibly complicated to digitize sound and convert it. I also need to render osm data and after getting lost with MBTiles, bit the bullet and am doing it the png tiles way using Maperitive.

(11 Jan '15, 04:16) nikhilvj

Maperitive will go from OSM data to Mbtiles directly. Using the default rules files from Maperitive, the output is identical (almost) to OSM rendering. I export to mbtiles for a 5 mile radius area (zooms 10-19) every few months without issue on a windows PC. Takes about 6 hours.

permanent link

answered 09 Jul '15, 12:21

RJCorazza's gravatar image

accept rate: 0%

There are two general approaches to making mbtiles archives.

1) Generate the tiles yourself, and put them in the mbtiles archive.

For this you'll need a working copy of Tilemill, osm2pgsql and openstreetmap-carto. Load your extract into the database with osm2pgsql, use the openstreetmap-carto stylesheets (which work fine as a Tilemill project) to apply the normal style rules to your data, and use the Tilemill as a nice user interface to pick the area that you want, and export your mbtiles archive.

2) Bulk-download someone else's map tile images, and put them into an mbtiles archive directly.

Note that very few people do this, and so I'm not sure there's even some scripts available for you to run that will do the whole thing, and it's against the T&Cs of most tileserver providers to run bulk downloads anyway.

You ask for "a simple way to take .osm and shove it into a .MBTiles" but there's nothing fundamentally simple about it. At some point the raw OSM data needs styling and converting into tiles, either by you or by someone else.

permanent link

answered 02 Aug '13, 17:57

Andy%20Allan's gravatar image

Andy Allan
accept rate: 28%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 02 Aug '13, 11:51

question was seen: 24,479 times

last updated: 09 Jan '16, 14:46

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum