simonw / datasette-tiles

Mapping tile server for Datasette, serving tiles from MBTiles packages
https://datasette.io/plugins/datasette-tiles
7 stars 5 forks source link

MBTiles databases from maptiler.com do not work. #24

Open pjamargh opened 2 years ago

pjamargh commented 2 years ago

MBTiles downloaded from MapTiler are not recognized as a tile database.

These sqlite databases are not detected on the MBTiles recognizer (datasette-tiles/datasette_tile/utils.py method detect_mtiles_databases). The reason is that the table containing all the required columns doesn't exist as a table but as a view.

Example download link: https://data.maptiler.com/downloads/europe/spain/vigo/ Create view statement:

CREATE VIEW tiles AS   SELECT 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 map.tile_id = images.tile_id