geozarr-spec icon indicating copy to clipboard operation
geozarr-spec copied to clipboard

Specify the object type in the object metadata

Open TomAugspurger opened this issue 7 months ago • 0 comments

If I'm reading https://github.com/zarr-developers/geozarr-spec/blob/main/geozarr-spec.md correctly, there are a few types defined by geozarr:

  • DataArray
  • Coordinate
  • Auxiliary Data (should this be "Auxiliary Variable" or just "Auxiliary"? The header says "Data" but the text says "variable")
  • Dataset

Could we amend the spec to require a field indicating the class / type an object represents? This will make it easier for tools to validate correctness.

Without this, I think that tools would need to infer based on _ARRAY_DIMENSIONS / dimension_names (zarr v3).

  • DataArray: one or more dimensions not equal to the name of the array, maybe?
  • Coordinate: exactly one dimension equal to the array name
  • Auxiliary Data: exactly zero array dimensions
  • Dataset: a Zarr Group

This might be unambiguous but it'd be much simpler to require a type field. Then you can catch issues with dimension_names itself, like a Coordinate field not having dimension name equal to itself.

This is common in other standards like STAC and OGC Features, which includes a required type field indicating whether an object is an Catalog, Collection, Feature, etc.

TomAugspurger avatar May 31 '25 21:05 TomAugspurger