Closed spwoodcock closed 1 week ago
On the metadata:
There was a bug with how the metadata is written to the mbtiles file that is getting fixed in #33. See that ticket for more information about what the bug was.
On the database schema:
We use a database schema that stores the tile data in a separate table keyed by the hash of the data, allowing us to deduplicate data. The table required by the mbtiles spec is realized using a view that joins the data with its hash and the tile ID. On large (~more than a few thousand tiles) tilesets, the chance of duplication is pretty high, and it saves a lot of storage space to do this deduplication.
This should be resolved. Please reopen or file a new issue if you find something else wrong.
Amazing work! Thanks so much for your help on this 🙏
The deduplication via a view is a very neat trick, thanks for explaining 😄
This got me wondering if I could use the same MBTiles file also as an "BigPlanet" db supported by OSMAnd, simply by adding a view for the required table structure
First of all, thanks for this lib! It's ridiculously fast at downloading tiles - I'm impressed 😄
Failure writing metadata
.mbtiles
file.Command:
(am I missing something in the command?)
Output:
In can see the (presumed) gzipped images in the SQLite database table:
The error is here: https://github.com/tilezen/go-tilepacks/blob/fd9e5edb604ed5421e25419481099a3ad09507ac/tilepack/mbtiles_outputter.go#L115
Failing at the SQL command:
INSERT OR REPLACE INTO metadata (name, value) VALUES(?, ?)
because the database is closed already?MBTiles database format
On a side note, perhaps I also have a knowledge gap around the mbtiles spec, but I thought they were required to have database tables
metadata
andtiles
with columns as such:However, the final mbtiles file has tables
metadata
,images
, andmap
, with images having structure:And
map
having structure:This is probably intended, so please forgive my ignorance if so 🙏 But either way, I can't verify due to the metadata issue above!