Update with main changes#38
Merged
Merged
Conversation
For stores using the multiscales convention (multiscale-grid profile), compute the downsample factor for each level from the GeoTransform pixel sizes and expose it through a new `pyramidLevelDownsamples` profile hook. The existing `PyramidBadge` already renders "1:X" when `downsample` is non-null, but the map host (deck.gl tile path) never populated it. - Add `levelDownsamples: number[]` to `MultiscaleGridContext` - Add `pyramidLevelDownsamples?` to the `ZarrProfile` interface - Store per-level downsamples in `tile-activity.ts` via `setPyramid`; `tileLoadStart`/`tileLoadEnd` now look up the downsample for the current level from the table (image host flow is unaffected since it keeps using `setActiveLevel` which bypasses the table) - Pass downsamples from `App.tsx` when calling `setPyramid` Closes #33 Co-authored-by: Tyler Erickson <tylere@users.noreply.github.com>
…cale-detection Fix OME-Zarr mislabel; detect multiscales + link convention specs
…25-2349 Show scale ratio in pyramid badge for multiscale zarr stores
The image-orthographic profile (OME-Zarr bioimaging) was only reachable via an explicit ?p=image-orthographic. With no override, the default scalar-grid profile ran, found no lat/lon variables, and errored — so pasting an OME-Zarr URL (e.g. an IDR v0.5 plate) just failed. Mirror the existing MultiscaleStoreError redirect: scalar-grid's prepare now detects OME-Zarr markers in the root attrs and throws OmeZarrStoreError, which App.tsx catches to switch to image-orthographic (only when no ?p= is pinned). - isOmeZarrAttrs() detects v0.5 (`ome` wrapper), v0.4 root multiscales (with `axes`, distinct from CF/rioxarray pyramids), HCS plate/well, and bioformats2raw.layout. Checked BEFORE parseMultiscaleDatasets so a v0.4 OME root (which also has `datasets`) doesn't mis-route to multiscale-grid. - v0.4 (Zarr v2) stores have no root zarr.json, so scalar-grid's v3 open throws first; on that failure it retries a metadata-only auto-version open to sniff OME markers, else rethrows the original error (geographic fast path unchanged). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The level badge used a displayIndex where 1 = coarsest … N = finest, so a full-resolution OME-Zarr level read as "Level 3/3" — the opposite of the OME-Zarr/vizarr/napari convention where dataset 0 is finest. Relabel in the badge itself via a pure omeLevelLabel() helper: shown = N - level, max = N - 1. Both render hosts already feed the same displayIndex, so this one transform fixes the OME image host AND geographic multiscale stores (e.g. Meta CHM), with no changes to the loaders or stored values. Finest now reads "Level 0/N-1"; the "· 1:N" ratio is also shown at the finest level (1:1). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On the map host the level badge was driven only by the tile loader (tileLoadStart/End), which deck.gl calls on cache misses only. Revisiting an already-cached zoom fired no fetch, so the badge went stale and reflected fetching rather than what was on screen. deck.gl's TileLayer fires onViewportLoad(selectedTiles) on every viewport change once the selected tiles are loaded — including cache hits. But @developmentseed/deck.gl-raster's RasterTileLayer builds its inner TileLayer from a fixed prop list and never forwards that callback. ReportingZarrLayer subclasses ZarrLayer and clones the inner TileLayer to attach it, reporting the finest loaded selected tile's level via reportDisplayedTiles(). It no-ops for non-multiscale stores and while a fetch is in flight (the load path owns the level then). multiscale-grid now uses ReportingZarrLayer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ect-and-level-badge Auto-detect OME-Zarr + OME-Zarr level numbering + cache-independent level badge
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
tylere
added a commit
that referenced
this pull request
Jun 26, 2026
…cale-detection Merge pull request #38 from source-cooperative/main
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.
No description provided.