-
Notifications
You must be signed in to change notification settings - Fork 8
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
Sourcein@cogeotiff/coreto have afetchRangesoption, with amaxCoalesceBytes - Update
Tiffin@cogeotiff/coreto have afetchTilesoption, which will fetch multiple tiles at once, coalescing up tomaxCoalesceBytes - Update deck.gl
TileLayerwith a new user-facing propgetTileDataBatchedthat takes in an array of tiles and fetches all of them. This should be optional, falling back togetTileDataif it doesn't exist. - Update
Tileset2Dclass to callgetTileDataBatchedif it exists. Ref https://github.com/visgl/deck.gl/blob/32c5d8d91dea69bc14839283c5bbc2600603725b/modules/geo-layers/src/tileset-2d/tileset-2d.ts#L264 - Update
COGLayerto pass ingetTileDataBatched, which calls the underlyingcogeotiff'sfetchTiles