mbtiles files won't upload to Mapbox
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 32
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
When I attempt to upload an .mbtiles file created with tile-count-tile to Mapbox I get this error : "vector_layers must be an array of layer objects"
I found that I can get around this by first exporting the mbtiles to a directory with [mbutil](https://github.com/mapbox/mbutil). The editing the "json" key in metadata.json from
```
"json": "{\"vector_layers\": [ ],\"tilestats\": {\"layerCount\": 0,\"layers\": []}}",
```
to
```
"json": "{\"vector_layers\":[{\"id\":\"count\",\"description\":\"\",\"minzoom\":10,\"maxzoom\":14,\"fields\":{\"density\":\"Number\"}}],\"tilestats\":{\"layerCount\":0,\"layers\":[]}}"
```
(I had set specific min and max zooms with tile-count-tile so I made them match in the json)
Then, after re-packing back to a .mbtiles with mbutil, mapbox would accept the upload.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the upload using an .mbtiles file created by tile-count-tile, then inspect the generated metadata.json and its json key. Use the mbutil export and repack steps described in the report to compare the metadata before and after the workaround. Done means the generated .mbtiles uploads to Mapbox without manual metadata editing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100