Skip to content

refactor: rely on deck.gl 9.4 for center-first tile loading - #669

Merged
kylebarron merged 3 commits into
mainfrom
kyle/remove-tile-sort
Sep 23, 2026
Merged

kylebarron merged 3 commits into
mainfrom
kyle/remove-tile-sort

Conversation

@kylebarron

@kylebarron kylebarron commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

deck.gl's TileLayer now has native center-first tile loading support, so we no longer need our workarounds


Note

This PR description was written by Claude (Claude Code), not by @kylebarron.

Since deck.gl 9.4, Tileset2D ranks tile requests by screen distance from the viewport center and re-ranks them as the view moves. That makes our own center-out sorts from #477 redundant, so this removes them.

  • RasterTileset2D (COGLayer, MultiCOGLayer, ZarrLayer): getTileIndices returns the traversal result without sorting.
  • MosaicTileset2D (MosaicLayer): getTileMetadata now returns the tile bbox as {west, south, east, north} instead of an array. deck.gl only reads that shape, so before this change every mosaic tile got the same fallback priority. Its sort is removed too.
  • Picking fix for mosaic tiles: deck.gl's cull-rect visibility check, used when picking, read the old array bbox as undefined and dropped every mosaic tile. The object bbox fixes that as a side effect.
  • Deleted: sort-by-distance.ts, its tests, and the internal _sortItemsByDistanceFromViewportCenter export.
  • Docs: the center-out spec is marked as superseded.

Not a breaking change: MosaicTileset2D isn't exported, the MosaicLayer callbacks still receive the source with its bbox array, and MosaicSource.bbox is unchanged.

Testing

  • New test: mosaic tile metadata has a {west, south, east, north} bbox. It failed before the change.
  • Removed the tests that called the deleted sorts.
  • All package tests, typecheck, and Biome pass.
  • Checked in the browser: naip-mosaic and cog-basic both render and fill in from the center outward.

🤖 Written by Claude Code on behalf of @kylebarron.

Since deck.gl 9.4, Tileset2D prioritizes tile requests by screen distance
from the viewport center, so our own center-out sorts in RasterTileset2D
and MosaicTileset2D are redundant. Remove them, along with the
sort-by-distance helper and its internal cross-package export.

deck.gl only reads `{west, south, east, north}` tile bboxes, so
MosaicTileset2D now returns that shape from getTileMetadata instead of an
array. That also lets mosaic tiles pass deck.gl's cull-rect visibility
check, which previously dropped every mosaic tile from picking.
MosaicSource.bbox is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@kylebarron
kylebarron enabled auto-merge (squash) September 23, 2026 20:56
@kylebarron
kylebarron merged commit a0886c9 into main Sep 23, 2026
3 checks passed
@kylebarron
kylebarron deleted the kyle/remove-tile-sort branch September 23, 2026 21:00
willjnz added a commit to willjnz/deck.gl-raster that referenced this pull request Sep 29, 2026
…istic work) into frankenstein

Resolved conflicts against the already-merged origin/main:
- mosaic-tileset-2d.ts: kept the antimeridian-crossing-fixes world-copy gate
  fix (subViewports != null, robust stale-index guard), preserved
  frankenstein's GeoBoundingBox-returning getTileMetadata, and dropped the
  now-redundant maxRequests/sortItemsByDistanceFromViewportCenter block
  (removed upstream in developmentseed#669 now that deck.gl 9.4 handles center-first
  loading natively).
- render-gray.ts / data.ts / README: kept the more current, non-contradictory
  versions (createTextureProps shared helper; MosaicLayer's own
  normalizeSourceBbox handles antimeridian unwrapping internally, so the
  example no longer needs to do it manually).
- Updated mosaic-tileset-2d.test.ts's "does not run world-copy passes"
  case for subViewports.length === 1 to match the corrected gate semantics
  (it now correctly finds a source needing a shifted world-copy pass even
  when only one subViewport is visible).
- pnpm-lock.yaml regenerated via pnpm install.

Full monorepo build + test suite green (deck.gl-raster 155/155,
deck.gl-geotiff 43/43, and all other packages) after `git submodule update
--init --recursive` to pull in previously-uninitialized geozarr submodules.
kylebarron added a commit to willjnz/deck.gl-raster that referenced this pull request Oct 21, 2026
…idian

Resolve conflicts in MosaicTileset2D: keep the world-copy search passes
and apply main's `extent` filter (developmentseed#688) to their combined matches. Main
removed the center-out sort (developmentseed#669), so the merge drops it too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant