mapbox / mapbox/tippecanoe

Feature Request: --one-tile option for tile-join

Open
#922 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3.1k
Forks
430
PR merge metrics
No merged PRs in 30d

Description

I have a similar situation to https://github.com/mapbox/tippecanoe/issues/109 where I am constantly amending an mbtiles with new geojson using tile-join. I have a serverless backend that serves vector tiles. Sometimes the mbtiles requires many updates in quick succession so re-generating, deleting and uploading all the files for the standard output wasn't feasible. Currently I fetch the mbtiles, generate the tiles and return the requested x/y/z. This works but it still requires me to generate hundreds of files on each request (they are cached but still), it would be great if tile-join had a `--one-tile` property similar to tippecanoe.

To summarize, for updating tiles I do essentially:
- fetch `existing.mbtiles`
- `tile-join -f -o /tmp/existing.mbtiles /tmp/new.mbtiles /tmp/old.mbtiles`
- `upload new.mbtiles` as `existing.mbtiles`

Then on each vector tile request to /endpoint/z/x/y
- fetch `existing.mbtiles`
- `tile-join -f -e /tmp/tiles -z18 --layer=run /tmp/existing.mbtiles` <- this generates the entire structure unnecessarily
- return `/tmp/tiles/z/x/y.pbf`

Admittedly I'm not sure how much of a performance gain I'd get by only generating one tile since I don't know the implementation details but this would be helpful. If you know of a better way of doing what I'm doing that I'm open to that as well, thank you.

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

Start by reviewing tile-join's handling of the -e/--output-to-directory and -z options, then compare the related --one-tile behavior in tippecanoe referenced by the issue. Define how tile-join should receive the requested z/x/y and verify that only that vector tile is produced while preserving the existing MBTiles workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
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.