Pergunta

I'm using Nutiteq SDK to develop an Android map app that needs to work offline and display a map of a small city, so im working with .mbtiles file. So far, an .mbtile file downloaded using TileMill worked great, or rather one of their demo projects, because Internet access is sometimes a big problem for me, for that same reason, it sounded great when a friend of mine told me he wrote a Python script to create an .mbtiles file from a tiles .png folder, with the exact .mbtiles format. I tried using a file obtained this way and i get the following error when loading files:

10-02 00:11:41.976: DEBUG/hellomap(404): DbMapLayer: Start loading  zoom=10 x=277 y=444
10-02 00:11:41.976: DEBUG/hellomap(404): DbMapLayer: Start loading  zoom=10 x=278 y=444
10-02 00:11:41.976: DEBUG/hellomap(404): DbMapLayer: Start loading  zoom=10 x=277 y=443
10-02 00:11:41.976: DEBUG/hellomap(404): DbMapLayer: Start loading  zoom=10 x=278 y=443
10-02 00:11:41.976: DEBUG/hellomap(404): DbMapLayer: Start loading  zoom=10 x=277 y=445
10-02 00:11:41.976: DEBUG/hellomap(404): DbMapLayer: Start loading  zoom=10 x=278 y=445
10-02 00:11:41.976: DEBUG/hellomap(404): DbMapLayer task: Start loading  zoom=10 x=277        y=444
10-02 00:11:42.340: DEBUG/TileDatabaseHelper(404): not found z=10 x=277 y=579
10-02 00:11:42.340: ERROR/hellomap(404):      com.nutiteq.layers.raster.MBTilesMapLayer$DbFetchTileTask: No data.
10-02 00:11:42.536: DEBUG/hellomap(404): DbMapLayer task: Start loading  zoom=10 x=278 y=444
10-02 00:11:42.636: DEBUG/TileDatabaseHelper(404): not found z=10 x=278 y=579
10-02 00:11:42.636: ERROR/hellomap(404):     com.nutiteq.layers.raster.MBTilesMapLayer$DbFetchTileTask: No data.
10-02 00:11:42.746: DEBUG/hellomap(404): DbMapLayer task: Start loading  zoom=10 x=277 y=443
10-02 00:11:42.746: DEBUG/TileDatabaseHelper(404): not found z=10 x=277 y=580
10-02 00:11:42.746: ERROR/hellomap(404): com.nutiteq.layers.raster.MBTilesMapLayer$DbFetchTileTask: No data.
10-02 00:11:42.947: DEBUG/hellomap(404): DbMapLayer task: Start loading  zoom=10 x=278 y=443
10-02 00:11:43.186: DEBUG/hellomap(404): onDrawFrame: Last frame time 325ms
10-02 00:11:43.346: DEBUG/TileDatabaseHelper(404): not found z=10 x=278 y=580
10-02 00:11:43.360: ERROR/hellomap(404): com.nutiteq.layers.raster.MBTilesMapLayer$DbFetchTileTask: No data.
10-02 00:11:43.360: DEBUG/hellomap(404): DbMapLayer task: Start loading  zoom=10 x=277 y=445
10-02 00:11:43.596: DEBUG/hellomap(404): onDrawFrame: Last frame time 230ms
10-02 00:11:43.706: DEBUG/TileDatabaseHelper(404): not found z=10 x=277 y=578
10-02 00:11:43.706: ERROR/hellomap(404): com.nutiteq.layers.raster.MBTilesMapLayer$DbFetchTileTask: No data.
10-02 00:11:43.706: DEBUG/hellomap(404): DbMapLayer task: Start loading  zoom=10 x=278 y=445
10-02 00:11:43.706: DEBUG/TileDatabaseHelper(404): not found z=10 x=278 y=578
10-02 00:11:43.706: ERROR/hellomap(404): com.nutiteq.layers.raster.MBTilesMapLayer$DbFetchTileTask: No data.
10-02 00:11:43.966: DEBUG/hellomap(404): onDrawFrame: Last frame time 249ms

I'm guessing something wrong with the script, but the fact is he is using the same .mbtiles file with the MapBox iOS SDK without problem.

I was hoping someone who has worked with maps, preferably with MBTiles and/or Nutiteq can give some insight.

Thanks.

Foi útil?

Solução

From the log it seems that the requested map tiles are just missing from the database. You can check it with

sqlite3 <file>.mbtiles
sqlite> select * from tiles where zoom_level=10 and tile_column=277 and tile_row=579;

If this returns empty data, then the data is not there. If it returns a line, then check that the file was opened properly.

There is also possibility that y is flipped, as TMS has different origin than common web map tiles (like OSM). You can change this in application, MBTilesLayer has setTmsY(), try to set it true.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top