Skip to content

Generate test mbtiles on the fly rather than storing them #1846

@nyurik

Description

@nyurik

We currently have a number of .mbtiles files checked in for various testing. Some of them are also used for documentation / quickstart guides. I think we should rework this for security and readabilty reasons, with the following actionables:

  • Create several schema initialization .sql files, e.g. in mbtiles/sql/ dir, add init-flat.sql, init-flat-with-hash.sql, etc.
    • Use content of these files directly in the docs, rather than copy/paste it. See {{#include file.rs}} syntax
    • Use these files in the test.sh before populating them with data
    • Use these files in the unit tests
    • Update docs to use these files with the sqlite command to create a blank .mbtiles file
  • Export all existing .mbtiles test files as .sql files, e.g. by using sqlite3's .dump command.
    • Remove any schema creation - and reuse the above ones. We may need to include the schema name in the file name to ensure the right schema is used... unless we can somehow transclude one file inside the other -- i am not sure if .read filename.sql can be used from another .sql file?
    • For image content, each tile content should be stored as an individual image file in a subdir - this way they can also be easily inspected. I think the readfile('...') sqlite function can be used to get the file content as part of the insert statement.
    • Same goes for the .mvt / .mlt content, except that sadly we have no way to store it in a viewable format - until someday we may have some simple json-mvt-mlt debug converter, or we could use ogr2ogr or another utility to store geojson - but this is not great because the output is less guaranteed.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions