Skip to content

When composed with multiscales, disallow spatial:transform at top level; require it on all layout items#15

Open
kylebarron wants to merge 5 commits intozarr-conventions:mainfrom
kylebarron:kyle/enforce-transform-multiscales
Open

When composed with multiscales, disallow spatial:transform at top level; require it on all layout items#15
kylebarron wants to merge 5 commits intozarr-conventions:mainfrom
kylebarron:kyle/enforce-transform-multiscales

Conversation

@kylebarron
Copy link
Copy Markdown

@kylebarron kylebarron commented Apr 7, 2026

Closes #12

Schema changes

  • If multiscales.layout exists, then spatial:transform must not exist at the top level
  • If multiscales.layout exists, then spatial:shape must not exist at the top level
  • If multiscales.layout exists, then spatial:transform must exist on all items within layout

Change list

  • Adds tests for invalid examples, to assert that they are correctly rejected by the schema validator.
    • sentinel2-tci.json is invalid because it doesn't have a spatial:transform on each item in layout.
    • dem-multiresolution.json is invalid because it has a spatial:transform at the top level.

@kylebarron kylebarron changed the title For multiscales, disallow transform at top level and require transform on all layout items When composed with multiscales, disallow spatial:transform at top level; require it on all layout items Apr 7, 2026
Comment on lines +225 to +230
"properties": {
"multiscales": {
"required": ["layout"]
}
},
"required": ["multiscales"]
Copy link
Copy Markdown
Author

@kylebarron kylebarron Apr 7, 2026

Choose a reason for hiding this comment

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

We could change this to look for the specific multiscales uuid instead of the fields multiscales and layout, though above it hard-codes multiscales and layout as keys anyways

@geospatial-jeff
Copy link
Copy Markdown

Just make transform and shape required everywhere. It doesn't hurt to be explicit, and it's tiny.

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.

Ambiguous usage of spatial:transform in conjunction with multiscales convention

2 participants