Skip to content

Refine spatial:dimensions: array-required + link dimension_names#25

Merged
emmanuelmathot merged 5 commits into
mainfrom
refine-spatial-dimensions
May 17, 2026
Merged

Refine spatial:dimensions: array-required + link dimension_names#25
emmanuelmathot merged 5 commits into
mainfrom
refine-spatial-dimensions

Conversation

@emmanuelmathot
Copy link
Copy Markdown
Contributor

@emmanuelmathot emmanuelmathot commented May 13, 2026

Refines the semantics of spatial:dimensions per issues #22 and #17. Per @maxrjones's review, the array-only / group-forbidden change (issue #23) has been split out and will be addressed in a separate PR.

Closes #22, #17.
Defers #23 to a follow-up PR.

Changes

Schema (schema.json)

  • spatial:dimensions is required on arrays via a top-level allOf / if (node_type == "array") / then. Groups are unrestricted — they may carry spatial:dimensions as a shared default for their child arrays, as before. The unconditional required previously sitting inside $defs/spatialAttributes is removed.

README

  • Properties table: Required column for spatial:dimensions now reads "On arrays".
  • #### spatial:dimensions section:
    • Each entry MUST match one of the array's dimension_names (a top-level Zarr V3 array metadata field, not an attribute).
    • Arrays using this convention MUST declare dimension_names.
    • Matching is by name, not by position — the order of entries is not significant; consuming conventions define their own ordering rules.
    • Dropped the row-major (["y", "x"]) ordering prescription.
  • Updated the proj: composition FAQ to drop the "standard axis ordering" bullet and clarify that spatial:dimensions is provided per array.

Examples

  • examples/proj.json: added dimension_names: ["Y", "X"] at the top level.
  • README array examples: added dimension_names at the top level.

Out of scope (deferred to a follow-up PR)

Why no schema-level enforcement of dimension_names?

dimension_names is a top-level Zarr V3 array metadata field rather than an attribute. The convention's schema describes the convention rather than redefining Zarr core metadata, so this requirement is captured as normative prose only.

Notes

…ement

- spatial:dimensions is now required on arrays and forbidden on groups
  (it has no unambiguous meaning at the group level since child arrays
  may have different dimensions). Closes #23.
- Document that arrays using this convention must declare Zarr V3's
  dimension_names metadata field, and that spatial:dimensions entries
  match dimension_names by name (not by position). Closes #22, #17.
- Drop the row-major ordering prescription from spatial:dimensions;
  matching is by name, so order is not significant. Closes #17.
- Update examples to add dimension_names on arrays and remove
  spatial:dimensions from the multiscales group example.
Comment thread README.md
Comment thread README.md
Comment thread README.md Outdated
Comment thread README.md
Comment thread README.md
Comment thread README.md
Affine transformation coefficients

- **Type**: `number[6]`
- **Required**: No (but required when `spatial:transform_type` is `"affine"` or omitted)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR #28 deals with this too

Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment thread README.md
Copy link
Copy Markdown
Contributor

@pvanlaake pvanlaake left a comment

Choose a reason for hiding this comment

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

There's still much work to be done on properly describing how coordinate space applies to the array elements. A lot of the language comes from the specific context of satellite imagery but it should be made much more neutral.

Co-authored-by: Patrick <pvanlaake@users.noreply.github.com>
@emmanuelmathot
Copy link
Copy Markdown
Contributor Author

Thx @pvanlaake but most of the comments are out scope of this PR. Let's move them to #28

Per @maxrjones review on #25: the array-only/group-forbidden
restriction (issue #23) is independent from the dimension_names
clarification (#22) and should land in its own PR.

Reverts:
- schema.json: removes the allOf conditional and restores
  unconditional 'required: spatial:dimensions' in spatialAttributes.
- README: properties table and section header back to 'Required: Yes';
  FAQ 'Can I use spatial: at the group level?' restored to original
  prose; multiscales example and bullets restore group-level
  spatial:dimensions.
- examples/multiscales.json: re-adds group-level spatial:dimensions.

Kept (still #22 / #17):
- spatial:dimensions entries must match the array's dimension_names
  (link to zarr-specs); matching is by name, not position.
- Row-major ordering prescription removed.
- dimension_names added to examples/proj.json and to the README
  array examples.
The 'spatial:dimensions is required on arrays' constraint stays as
part of #22 (arrays must declare the spatial axes that index into
their dimension_names). Only the 'forbidden on groups' rule from #23
is removed from this PR.

Schema: re-add the array-only conditional via allOf/if/then on
node_type, but without the group-side 'not required' branch. Groups
can still carry spatial:dimensions as a default for child arrays.

README: properties table 'On arrays'; spec section 'Required: Yes on
arrays; optional on groups (where it acts as a default for child
arrays).'
@emmanuelmathot emmanuelmathot changed the title Restrict spatial:dimensions to arrays; clarify dimension_names requirement Refine spatial:dimensions: array-required + link dimension_names May 17, 2026
@emmanuelmathot emmanuelmathot linked an issue May 17, 2026 that may be closed by this pull request
@emmanuelmathot emmanuelmathot merged commit c6f531c into main May 17, 2026
@emmanuelmathot emmanuelmathot deleted the refine-spatial-dimensions branch May 17, 2026 20:11
@pvanlaake
Copy link
Copy Markdown
Contributor

My bad, I got a little too enthusiastic... I'll have a look at the new version instead.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make dimension_names mandatory at array level spatial:dimensions and dimension ordering

3 participants