mapbox / mapbox/tile-count

mbtiles files won't upload to Mapbox

Open
#46 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.