Repository navigation
feat: Update land-cover example to have filterable categories - #506
Merged
Merged
Conversation
Captures the agreed approach for adding a category-filter UI to the land-cover example, including the switch to r8uint upload and three example-local shader modules wired via custom getTileData/renderTile. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Move the NLCD category list out of Legend.tsx so the upcoming CategoryFilter UI and colormap-texture builder can share a single source of truth. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Three example-local shader modules for the upcoming category-filter pipeline: - CreateTextureUint samples an r8uint source via usampler2D and introduces an `ivec4 icolor` function-local for downstream modules. - FilterCategory discards via a 256-byte LUT texture indexed by icolor.r. - PaletteColormap maps icolor.r to RGBA via texelFetch into a 256x1 colormap texture and writes it to color. The framework macro signature is unchanged. Integer pixel data flows between modules through a function-local `ivec4 icolor` declared by the producer module and consumed by the rest. luma.gl concatenates all fs:DECKGL_FILTER_COLOR injections into one function body, so the declaration is in scope for every subsequent injection. A future, typed shader-module abstraction can supersede this convention; tracked in the spec as an open follow-up. Adds @luma.gl/shadertools as a dependency of the example. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Pure helpers for constructing the two textures the integer-aware pipeline expects: a 256x1 RGBA colormap (alpha=0 at nodata, via parseColormap) and a 256x1 r8 boolean LUT for the active category selection. Adds @developmentseed/geotiff as a direct dependency of the example for parseColormap. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
getTileData uploads tiles as r8uint instead of the inferred r8unorm. makeRenderTile composes the integer-aware shader pipeline once the colormap and filter-LUT textures are available; until then it returns null so the layer renders nothing. Adds @developmentseed/deck.gl-raster as a direct dependency of the example for the RenderTileResult type. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Controlled checkbox tree mirroring the existing legend's grouping. Each heading toggles every leaf beneath it and renders indeterminate when its leaves are partially selected. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
App captures the luma.gl Device on first tile load, builds the colormap texture once the GeoTIFF metadata is parsed, and rebuilds the filter LUT texture whenever the user changes the category selection. CategoryFilter replaces the read-only Legend. Also widens COGLayer's user-facing renderTile prop type to allow returning null, matching the underlying RasterTileLayer capability added in #489. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- "All categories" master checkbox toggles every leaf, with the indeterminate state (the "minus" box) shown when partial. - Each heading is independently expandable/collapsible so the panel stays compact while the user drills into specific groups. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The colormap entry for the nodata index already has alpha=0 (set by parseColormap). Convert that signal into an explicit discard so the fragment is skipped entirely rather than relying on alpha-blended-to- zero, which would still pollute the depth buffer and consume blend bandwidth for invisible pixels. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Member
Author
|
We really need to implement #500. Right now it's fetching 32kb regions at a time when reading header metadata |
kylebarron
marked this pull request as ready for review
May 5, 2026 16:16
Replaces the getTileData wrapper that captured the Device on first tile load with the cleaner onDeviceInitialized callback on DeckGLOverlay, matching the pattern used in dynamical-zarr-ecmwf and naip-mosaic. Drops the customGetTileData useCallback entirely. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Screen.Recording.2026-05-05.at.9.52.31.AM.mov
Change list
land-coverexample to upload the texture to the GPU asuint8non-normalized texture values0, discard those pixels.