This project is read-only.

howto transform bing mbtiles 2 mapbox mbtiles


I tried to use your tool for mbtile conversions
i have made a custom tile stack from a scanned map with msr mapcruncher tool
and transformed that into a mobile database with mobac tool

that works in portable tileserver

but not with these mapbox (php) scripts

i think because these mbtile databases are internally quite different

a - do you think i can use Portable Basemap Server to transform them into the mapbox datamodel ?
b - if so how ?

file attachments


diligentpig wrote Dec 9, 2013 at 3:33 AM

I've investigated your attachments, and saw some png image in it. However, although your file name end with .mbtiles, but neither is it a MBtiles(that's why you can't see it in MapBox way) file nor a MobileAtlasCreator file. Because it doesn't include necessary tables of both specifications.
The problem is if you could create a file that is really mobac file, then PBS could do the conversion job for you to make out a mbtiles file.

hismap wrote Dec 9, 2013 at 7:12 AM

Hi there thanks for your effort,

you see only that little in my mobac file?

several sqlite tools tell me:
database properties: encoding : utf8

and i see 2 tables and 2 indexes:
CREATE TABLE metadata (name text, value text);
CREATE UNIQUE INDEX metadata_idx ON metadata (name);
CREATE TABLE tiles (zoom_level integer, tile_column integer, tile_row integer, tile_data blob);
CREATE INDEX tiles_idx on tiles (zoom_level, tile_column, tile_row);

metadata record 5:
rowid name value
5 description Amsterdam 1300 created on 2013-11-28 06:23:33 by MOBAC

the file i would say is still fresh

tilemill app says it can inport mbtiles but doesnt recognize my file, expects more tables, and mapbox website says tilemill can only inport mbtiles through mapboxlive (online service)

i do this because i want to use the utfgrid feature for my POI data: 100's of text, mp3 & mp4 pois


diligentpig wrote Dec 16, 2013 at 3:00 AM

I attached two images which show MBTiles schema and MAC schema separately. It seems that your file does not meet either of them. So you can't just import your file to tilemill or mapbox online. Check your schema first.

  • MBTiles:
    CREATE TABLE metadata (name TEXT, value TEXT)
    CREATE TABLE images (tile_data BLOB, tile_id TEXT)
    CREATE TABLE map (zoom_level INTEGER, tile_column INTEGER, tile_row INTEGER, tile_id TEXT)
    map.zoom_level AS zoom_level,
    map.tile_column AS tile_column,
    map.tile_row AS tile_row,
    images.tile_data AS tile_data
    FROM map JOIN images ON images.tile_id = map.tile_id
  • MAC:
    CREATE TABLE tiles (x int, y int, z int, s int, image blob, PRIMARY KEY (x,y,z,s))

wrote Dec 16, 2013 at 3:03 AM

diligentpig wrote Dec 16, 2013 at 3:03 AM

Here arc the 2 images.

wrote Dec 16, 2013 at 3:04 AM

diligentpig wrote Dec 16, 2013 at 3:04 AM

At top of the issue...