Skip to content

scratch work to assign spatial:transform when creating geozarr metadata - #36

Draft
kylebarron wants to merge 4 commits into
mainfrom
kyle/example-set-spatial-transform-geozarr-multiscale
Draft

kylebarron wants to merge 4 commits into
mainfrom
kyle/example-set-spatial-transform-geozarr-multiscale

Conversation

@kylebarron

Copy link
Copy Markdown
Member

Just creating a draft branch/PR to keep track of my changes to assign spatial:transform onto multiscales metadata

Comment on lines +33 to +34
scale_factor_x = overview.transform.a / geotiff.transform.a
scale_factor_y = overview.transform.e / geotiff.transform.e

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a change from the example on main. I think it's best to always calculate the scale factor in terms of both x and y, in case it differs. It does differ in some cases (such as in an NAIP sample image I use often) due to pixel rounding for overviews.

Comment on lines +47 to +51
multiscales_attrs["multiscales"]["layout"][0]["spatial:transform"] = list(geotiff.transform)
for item, overview in zip(
multiscales_attrs["multiscales"]["layout"][1:], geotiff.overviews, strict=True
):
item["spatial:transform"] = list(overview.transform)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After multiscales metadata has been created, this assigns spatial:transform onto each level

kylebarron added a commit to developmentseed/deck.gl-raster that referenced this pull request Nov 24, 2026
> [!NOTE]
> This PR was written by Claude (Claude Code) on behalf of @kylebarron,
not by @kylebarron.

### Why

`zarr-sentinel2-tci` reads its data from
`http://localhost:8080/TCI.zarr`. That store is generated locally with
developmentseed/geozarr-examples#36, a scratch branch that is still
open. Without that local build, the example shows only the basemap and
logs `Metadata loading failed in ZarrLayer: Failed to fetch`. This
happened when testing #887.

### Change

- Removes `examples/zarr-sentinel2-tci` and its lockfile entry.
- Nothing else needs to change. The docs workflow builds whatever
folders exist under `examples/`. The only other mentions are in dated
design specs under `dev-docs/specs/`, which I left as they are.

### Test plan

- [x] `pnpm install` and `biome ci` pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_011cLtCTBdsrQ7hy7i297xpJ

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant