visgl / visgl/deck.gl

[Feat] New `TileLayer` prop for fetching *multiple tiles* at once

Open
#10,098 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
TypeScript
Stars
14.6k
Forks
2.3k
Avg merge
2d 9h
Merged PRs (30d)
42

Description

Target Use Case

Right now the TileLayer only has a single method for getting per-tile data: the getTileData callback.

This is fine, or at least, the best we can do for most tiled data sources, such as MVT from an API, since there's a separate URL per tile.

But for some data sources, such as PMTiles (which stores a pyramid of MVTs in a single range-request addressable resource) and Cloud-Optimized GeoTIFF (which contain a similar pyramid of raster image data), all tile requests are ranges within one specific URL.

As noted by TileLayer.maxRequests, Chrome only allows 6 concurrent requests per domain on HTTP 1.

But, since:

  • these data sources are all contained in a single file/URL
  • internal tiles are laid out in a predictable layout, such as horizontal rows or a hilbert curve

If we know we're fetching many tiles at once, we can coalesce adjacent HTTP Ranges and reduce the number of requests we're making.

Right now, since getTileData is called independently for every tile, it's very difficult to know from inside getTileData the set of tiles being fetched at a time, and so it's impossible to do this range coalescing.

Proposal

ref https://github.com/developmentseed/deck.gl-raster/issues/273

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 in modules/geo-layers/src/tileset-2d/tileset-2d.ts at the referenced Tileset2D call site, then trace TileLayer's existing getTileData prop. Define the optional batched callback's tile-array behavior and fallback to getTileData, ensuring Tileset2D can request multiple tiles together for range coalescing.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.