Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct the mbtiles metadata format. #313

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

amandasaurus
Copy link
Contributor

The TileJSON format says that bounds & centre are arrays of numbers. But the mbtiles metadata table requires that it's a string o 4 comma separated numbers

If you don't do this, then mbutil can't convert the directory to a mbtiles file. You get this error:

Traceback (most recent call last):
  File "/home/amanda/.local/bin//mb-util", line 89, in <module>
disk_to_mbtiles(directory_path, mbtiles_file, **options.__dict__)
  File "/home/amanda/.local/pipx/venvs/mbutil/lib/python3.11/site-packages/mbutil/util.py", line 174, in disk_to_mbtiles
cur.execute('insert into metadata (name, value) values (?, ?)',
sqlite3.ProgrammingError: Error binding parameter 2: type 'list' is not supported

https://github.com/mapbox/mbtiles-spec/blob/master/1.3/spec.md#content https://github.com/mapbox/tilejson-spec/blob/84008d750e54f37739e24785276596f40ccafeab/2.2.0/schema.json#L59-L70

The TileJSON format says that `bounds` & `centre` are arrays of numbers.
But the mbtiles `metadata` table requires that it's a string o 4 comma
separated numbers

If you don't do this, then `mbutil` can't convert the directory to a
`mbtiles` file. You get this error:

    Traceback (most recent call last):
      File "/home/amanda/.local/bin//mb-util", line 89, in <module>
	disk_to_mbtiles(directory_path, mbtiles_file, **options.__dict__)
      File "/home/amanda/.local/pipx/venvs/mbutil/lib/python3.11/site-packages/mbutil/util.py", line 174, in disk_to_mbtiles
	cur.execute('insert into metadata (name, value) values (?, ?)',
    sqlite3.ProgrammingError: Error binding parameter 2: type 'list' is not supported

https://github.com/mapbox/mbtiles-spec/blob/master/1.3/spec.md#content
https://github.com/mapbox/tilejson-spec/blob/84008d750e54f37739e24785276596f40ccafeab/2.2.0/schema.json#L59-L70
@pka pka merged commit 30e5340 into t-rex-tileserver:master Feb 26, 2024
3 of 4 checks passed
@pka
Copy link
Member

pka commented Feb 26, 2024

Thanks!

pka added a commit that referenced this pull request Aug 17, 2024
pka added a commit that referenced this pull request Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants