Skip to content

fix: geometry handling in multiscale creation - #347

Merged
emmanuelmathot merged 2 commits into
mainfrom
fix/346-s2-geometry-conventions
Nov 10, 2026
Merged

emmanuelmathot merged 2 commits into
mainfrom
fix/346-s2-geometry-conventions

Conversation

@emmanuelmathot

Copy link
Copy Markdown
Contributor

Update geometry handling to ensure correct registration and metadata declaration for the conditions/geometry group in multiscale creation. This change addresses the conventions for spatial registration and improves the associated tests.

Fix #346

@claxn claxn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@emmanuelmathot thank you for the neat implementation and adding the missing zarr-conventions for the geometry path!

I guess it is necessary to add this to a new release before we start the backfilling operations?

@emmanuelmathot

Copy link
Copy Markdown
Contributor Author

@claxn Not urgent but definitively necessary for advanced openEO using the view angles. We can make another release with those changes. Your call.

@emmanuelmathot
emmanuelmathot merged commit 5dd1447 into main Nov 10, 2026
7 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 10, 2026
@claxn

claxn commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

@emmanuelmathot okay, please go ahead with the release of 0.13.1 then we will start to use this as a final version along with eopf-stac 1.1.0. Thanks!

d-v-b added a commit to d-v-b/data-model that referenced this pull request Nov 15, 2026
…S2 changes

main changed the DataTree-based S2 write path, which this branch
replaces with the model-based plan. Its changes are ported to the plan
rather than taken as written:

- Atmosphere (EOPF-Explorer#343): `quality/atmosphere` is a multiscale pyramid,
  10-720 m, in the plan's `AUX_MULTISCALE_LEVELS` as in main's
  `_AUX_MULTISCALES`. Only L2A products hold the group, so presence
  gives main's L2A-only rule. `aot` / `wvp` resample as reflectance, per
  main's `determine_variable_type`.
- Geometry (EOPF-Explorer#347, EOPF-Explorer#346): `conditions/geometry` declares the tile CRS with
  node registration. Its shape, transform and bbox come from the grid's
  x/y values: `plan_geozarr` takes an optional `coordinate_values`
  lookup, and `write_geozarr` passes its source reader's. The
  (y, x) angle arrays reference the grid mapping. A grid no transform
  describes is carried without georeferencing, with a warning.
  Resolution levels under `conditions/mask` and `quality` whose arrays
  carry no proj attributes, as in native Zarr V3 products, declare the
  tile CRS with pixel registration from the tile origin.
- Band statistics (EOPF-Explorer#333, EOPF-Explorer#344): computed by the shared root
  consolidation, which the plan path already calls. The STAC asset
  function takes either datasets or the plan's variable names, and keeps
  main's href-based duplicate check and key-collision warning.

Conflicts in s2_multiscale.py and the old-path tests take this branch's
side, since that code was removed. main's new statistics assertion is
kept, and its atmosphere and geometry tests are rewritten against the
plan. The snapshots are regenerated from the plan: the atmosphere and
detector-footprint groups match main's in structure and attribute keys.
The geometry group's value-derived attributes are tested with
coordinate values, in the plan and through the writer. The lock is
updated for the 0.13.1 version bump.

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Sentinel-2: conditions/geometry has no CRS and no GeoZarr conventions

2 participants