Mbtiles is a map tile storage data specification, it uses SQLite database, can greatly improve the reading speed of massive map tiles, than through the tile file way of reading much faster, suitable for Android, iphone and other smart phone offline map storage. For more information, please refer to: Mbtiles Mobile Storage Introduction.
In the Web map introduction We see that tiles refer to their z/x/y form coordinates, on disk storage, they are usually stored in a directory with Z, x as the name, so that a tile file path is 0/0/0.png.
Also with Google or Baidu map JS API is very convenient to call. But there is a drawback is that more files, take up disk space is much larger than the actual file, resulting in a lot of file fragments, moving very cumbersome, slow. Mbtiles provides such a feature: Tile table, Tiles:
sqlite> SELECT * FROM tiles;
zoom_level | tile_column | tile_row | tile_data
5 | 13 | 23 | [PNG data]
5 | 13 | 24 | [PNG data]
5 | 14 | 23 | [PNG data]
5 | 14 | 24 | [PNG data]
5 | 15 | 25 | [PNG data]
This table is easy to query for a particular tile: for example, the query level is 8, the column number is 116, the row number is 192 of the tile data:
sqlite> SELECT tile_data FROM tiles WHERE zoom_level = 8 AND tile_column = 116 AND tile_row = 192;
[PNG data]
tile_data is a binary stream file, which can be used to easily read tile data from the Mbtiles database, whether it is used in desktop programs or Android or iOS applications.