Repository navigation
refactor(deck.gl-geotiff): keep one layer per source class, and build MultiCOGLayerProps from RasterTileLayerProps - #820
Conversation
…yerProps MultiCOGLayerProps picked five TileLayer props and redeclared maxError, debug, debugOpacity, signal and pool. The layer took every RasterTileLayer prop, but the exported type rejected extent, zRange, minZoom, zoomOffset, onTileLoad and the rest. It now starts from RasterTileLayerProps, as COGLayerProps does, and takes `pool` from COGLayerProps, so it adds only its source and band props. `signal` is declared once, on RasterTileLayerProps, with the note that it doesn't abort opening `source`. COGLayer's docs point to MultiCOGLayer for bands stored as separate files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Decision 25: COGLayer draws a COGSource, MultiCOGLayer a MultiCOGSource, and ZarrLayer a ZarrSource. One layer for both COG classes would need a union for `onSourceLoad`, props that apply to one kind of source only, and tile callbacks typed for the wrong data. This replaces stage 5's plan for COGLayer to take over MultiCOGLayer, and answers open question 4. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
|
||
| /** A user-provided AbortSignal to cancel tile requests. It doesn't abort | ||
| * opening `source`: the layer aborts that itself when `source` changes or | ||
| * the layer is removed. | ||
| * | ||
| * This can be useful in combination with the MosaicLayer, so that when a | ||
| * mosaic source is out of the viewport, all of its tile requests are | ||
| * automatically aborted. | ||
| */ | ||
| signal?: AbortSignal; |
There was a problem hiding this comment.
why do we take this out again? Because it's now on the source?
There was a problem hiding this comment.
Note
This reply was written by Claude (Claude Code), not by @kylebarron.
It's not on the source. COGLayer still has signal: COGLayerProps starts from Omit<RasterTileLayerProps<DataT>, "tilesetDescriptor" | "getTileData" | "renderTile">, which keeps it. This declaration only repeated the base one (62ccec4).
- Its rule moved. It said the signal doesn't abort opening
source. That's true of every layer with a source, sinceRasterTileLayerdoes the opening, so the note now sits on the base declaration (the thread below). - The MosaicLayer tip was dropped. It was stale: deck.gl doesn't abort a tile once it has loaded. So the signal MosaicLayer passes to
renderSourcecan only abort while the item's source is opening, never the COGLayer's tile requests afterwards.
🤖 Written by Claude Code
| * per-tile signal. It doesn't abort opening `source`: the layer aborts | ||
| * that itself when `source` changes or the layer is removed. | ||
| */ | ||
| signal?: AbortSignal; |
There was a problem hiding this comment.
oh it's because signal is inherited from here?
There was a problem hiding this comment.
Note
This reply was written by Claude (Claude Code), not by @kylebarron.
Yes, every RasterTileLayer subclass inherits signal from here. COGLayer and MultiCOGLayer redeclared it only to add the note about source, which now lives here once, so ZarrLayer's docs get it too (62ccec4).
🤖 Written by Claude Code
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
This replaces stage 5 of the Sources design (
dev-docs/specs/2026-10-22-sources-design.md, decision 25): each source class keeps its own layer. COGLayer draws aCOGSource, MultiCOGLayer aMultiCOGSource, and ZarrLayer aZarrSource.Stage 5 planned for COGLayer to take over MultiCOGLayer's band compositing, and to deprecate MultiCOGLayer. But one layer for both COG classes would need:
onSourceLoad, since TypeScript can't pick props by whatsourceholds;With one layer per class, each layer's types are exact. A mosaic returns the right layer for each item's source from
renderSource, as it already can.MultiCOGLayerPropsIt now starts from
RasterTileLayerProps, asCOGLayerPropsdoes, and takespoolfromCOGLayerProps, so no prop is declared twice:maxError,debug,debugOpacity,signalandpool.new MultiCOGLayer(...)already accepted every RasterTileLayer prop, so callers see no change.MultiCOGLayerPropstype, though, lackedextent,maxZoom,minZoom,onTileError,onTileLoad,onTileUnload,onViewportLoad,tileSize,zRangeandzoomOffset.signalis declared once, onRasterTileLayerProps, with the note that it doesn't abort openingsource. COGLayer stops redeclaring it too.pooldocs no longer mention a GeoTIFFLayer, which doesn't exist.Tests
tsc:MultiCOGLayerPropstakes everyCOGLayerPropsprop exceptgetTileDataandrenderTile. This failed before the change, naming the ten props above.COGLayerPropsarecomposite,renderPipeline,resamplinganddebugLevel.🤖 Written by Claude Code