HEALPix Zarr tile layers#7
Open
danielfdsilva wants to merge 13 commits into
Open
Conversation
The new `debugTiles` prop for `HealpixZarrTileLayer` renders outlines and `z-y-x` labels on loaded tiles, aiding in debugging tile loading and partition boundaries.
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.
Deck.gl layer for HEALPix rasters in Zarr, plus a draft store spec, a Sentinel-2 conversion example, and a demo app.
Summary
On this branch:
docs/specs/healpix-pyramid-zarr.md: draft spec for the store layoutpackages/deck.gl-healpix-zarr:HealpixZarrTileLayerreads conformant storessentinel2-zhealpix/: Python pipeline (Sentinel-2 L2A to Zarr) as a worked exampleexamples/zarr-tiles: interactive demoTogether these show how a multiscale HEALPix raster dataset can be explored.
Zarr file structure
The layer only reads HEALPix Pyramid Zarr (Zarr v3). The draft spec is
docs/specs/healpix-pyramid-zarr.md.A store is a tree of resolution levels (
nside_128/,nside_256/, up tobase_nside). Each level has:cell_id: which HEALPix cells have data (sparse; no row means no value)parent_offsets: CSR index from parent cell to row range in the packed arrays (parent_offsetsin the spec)bands/<name>: one float array per variable (e.g.b04,b03,b02for Sentinel-2)Root metadata lists bands, the resolution range, and how parent grids relate to data nside.
Chunking
parent_offsets. The array length is12 * nside_parent² + 1. It can be huge, but each tile load only needsparent_offsets[p]andparent_offsets[p+1]to get rows for parentp. Over HTTP, Zarr reads whole chunks. If the CSR index is one chunk, every tile pulls the full array again. Chunks around 4096 entries (~32 KB foruint64) usually mean a lookup is one small range request. The layer then slicescell_idand the requestedbands/<name>with[rowStart:rowEnd]. Step-by-step: Reader load sequence in the spec.This spec is a suggestion. I'm not very familiar with everything that goes into a spec like this one, but I needed something to start with, and on which to base the layer implementation.
Sentinel-2 conversion (example)
sentinel2-zhealpix/is an example of building a conformant store from real scenes. Nothing in the layer imports it at runtime; it only writes Zarr the layer can open.parent_offsetsOutput:
mosaic.zarr, ready to host.cd sentinel2-zhealpix uv run python -m sentinel2_zhealpix run-all \ --urls https://example.com/S2B_MSIL2A_20260101T110351_T29SND.zarr \ --out-dir ./outputMore detail:
sentinel2-zhealpix/README.md.HealpixZarrTileLayer
HealpixZarrTileLayerdraws a remote or local Zarr store on a deck.gl map. It:HealpixCellsLayerin@developmentseed/deck.gl-healpixCachedZarrStoreExample
Full demo: https://deck.gl-healpix.ds.io/examples/zarr-tiles/