developmentseed / developmentseed/deck.gl-raster
Extend deck.gl tile fetching to enable multi-tile fetches
- Dominant language
- TypeScript
- Stars
- 228
- Forks
- 29
- Avg merge
- 12h 27m
- Merged PRs (30d)
- 4
Description
**Problem statement**: currently, deck.gl has just one available callback for fetching tiles: `TileLayer.getTileData`. This is user-provided and is always called with _just one_ tile at a time. This means that _all fetches_ are necessarily independent.
For most historical uses of the deck.gl TileLayer this is not a problem. For sources like MVT, the tile responses usually come from different URLs in a single domain, and there would be no possibility to coalesce requests.
**However** for newer data sources like PMTiles or COG, each individual tile data source comes from the _same URL_. This means that we're unnecessarily making many requests when we could potentially make many fewer by coalescing tile ranges. E.g. if we have 20 tiles in the current viewport, we currently are forced to always make 20 requests, whereas if it's a grid of 5 columns by 4 rows, then with request coalescing we could make no more than 4 requests (one per row, where each row's bytes are adjacent in memory)
**Requirements**:
- [ ] Update `Source` in `@cogeotiff/core` to have a `fetchRanges` option, with a `maxCoalesceBytes`
- [ ] Update `Tiff` in `@cogeotiff/core` to have a `fetchTiles` option, which will fetch multiple tiles at once, coalescing up to `maxCoalesceBytes`
- [ ] Update deck.gl `TileLayer` with a new user-facing prop `getTileDataBatched` that takes in an array of tiles and fetches all of them. This should be optional, falling back to `getTileData` if it doesn't exist.
- [ ] Update `Tileset2D` class to call `getTileDataBatched` if it exists. Ref https://github.com/visgl/deck.gl/blob/32c5d8d91dea69bc14839283c5bbc2600603725b/modules/geo-layers/src/tileset-2d/tileset-2d.ts#L264
- [ ] Update `COGLayer` to pass in `getTileDataBatched`, which calls the underlying `cogeotiff`'s `fetchTiles`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.