t-rex-tileserver / t-rex

t-rex is a vector tile server specialized on publishing MVT tiles from your own data
https://t-rex.tileserver.ch/
MIT License
556 stars 69 forks source link

Correct the mbtiles metadata format. #313

Closed amandasaurus closed 7 months ago

amandasaurus commented 7 months ago

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 commented 7 months ago

Thanks!