Skip to content

ENH: Implement write support for Zarr conventions#918

Merged
snowman2 merged 3 commits intocorteva:masterfrom
emmanuelmathot:zarr-conventions-write
Mar 13, 2026
Merged

ENH: Implement write support for Zarr conventions#918
snowman2 merged 3 commits intocorteva:masterfrom
emmanuelmathot:zarr-conventions-write

Conversation

@emmanuelmathot
Copy link
Contributor

Description

Implements write support for the Zarr spatial and proj conventions, replacing the NotImplementedError stubs in ZarrConvention introduced in #900.

  • Adds add_convention_declaration, format_proj_wkt2, format_proj_code, and format_spatial_transform utilities in zarr.py
  • Implements ZarrConvention.write_crs: writes proj:wkt2 (always) and proj:code (when authority is available), and declares the proj: convention in zarr_conventions
  • Implements ZarrConvention.write_transform: writes spatial:transform, spatial:dimensions, spatial:shape, spatial:bbox (via rasterio.transform.array_bounds), and spatial:registration, and declares the spatial: convention
  • Enables data.rio.write_crs("EPSG:4326", convention=Convention.ZARR) and data.rio.write_transform(transform, convention=Convention.ZARR)

@emmanuelmathot emmanuelmathot changed the title ENH: Implement write support for Zarr spatial and proj conventions with corresponding tests ENH: Implement write support for Zarr conventions Mar 8, 2026
@snowman2 snowman2 added the enhancement New feature or request label Mar 9, 2026
@snowman2 snowman2 added this to the 0.23.0 milestone Mar 9, 2026
@emmanuelmathot emmanuelmathot marked this pull request as ready for review March 10, 2026 08:50
@emmanuelmathot emmanuelmathot requested a review from snowman2 March 10, 2026 12:20
@snowman2
Copy link
Member

snowman2 commented Mar 10, 2026

Just need to run the command pre-commit run -a to address the linting issues.

@emmanuelmathot emmanuelmathot requested a review from snowman2 March 13, 2026 08:53
@snowman2 snowman2 merged commit a2fb21b into corteva:master Mar 13, 2026
14 of 22 checks passed
@snowman2
Copy link
Member

Thanks @emmanuelmathot 👍

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Support Zarr Spatial and Geo-Projection Conventions in rioxarray

2 participants