1

I am trying to generate MBTiles with MOBAC, to be used in an offline map Android application (trying to use OSMDroid).

Now I generate the atlas, but something goes wrong because I get the error

android.database.sqlite.SQLiteException: no such table: images (code 1): , while compiling: SELECT tile_data FROM images LIMIT 0,1

This is my MOBAC setup:

enter image description here

4
  • Where do you get the error? I have never had problems making mbtiles in mobac – Devdatta Tengshe Aug 9 '14 at 15:46
  • @DevdattaTengshe Hi Devdatta when I try to open the file in my application I get the error, additionally if I try to visualize the map with MapTiler no image is shown, and if I open the file with as SQLite it seems that there are no images tables – Lisa Anne Aug 9 '14 at 15:58
  • That's very strange. Have you tried your application with a known good mbtiles file? – Devdatta Tengshe Aug 9 '14 at 18:22
  • @DevdattaTengshe actually yes, with tiles created with MapTiler it works :-((( – Lisa Anne Aug 9 '14 at 19:49
1

You say that you are getting the error:

android.database.sqlite.SQLiteException: no such table: images (code 1): , while compiling: SELECT tile_data FROM images LIMIT 0,1

You are getting this error, because you are trying to query a table called images. The Mbtiles spec does not mention this table at all.

According to the MbTiles spec, the Mbtiles database has two tables: metadata and tiles. It is the later table which contains the images for the tile.

This table is created with the following SQL command: CREATE TABLE tiles (zoom_level integer, tile_column integer, tile_row integer, tile_data blob);

Your problem is due to querying for a table which is not mentioned in the specifications. I'll suggest that you have a look at the code of your application, and query the correct table.

0

I changed the extension .mbtiles .sqlite and open with firefox sqlite manager and launched this Requette :

CREATE TABLE images as
SELECT ROWID, "tile_data", tile_row as "tile_id"
FROM "tiles"
ORDER BY ROWID

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.