Skip to content

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

@kylebarron

Description

@kylebarron

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

  • Update TileLayer with a new user-facing prop getTileDataBatched (open to naming suggestions) that takes in an array of tiles and fetches all of them. This prop should be optional, falling back to calling getTileData if getTileDataBatched doesn't exist
  • Update Tileset2D class to call getTileDataBatched. Ref
    this._selectedTiles = tileIndices.map(index => this._getTile(index, true));

ref developmentseed/deck.gl-raster#273

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions