Skip to content

Conversation

@emmanuelmathot
Copy link

This is the second in a series of PRs splitting #883 as requested by maintainers. Depends on #899.

Changes:

  • Add Convention.Zarr enum value
  • Create _convention/zarr.py module with read functions for Zarr conventions
  • Update rioxarray.py to try both conventions when reading (CF first by default, Zarr first with set_options(convention=Convention.Zarr))
  • Support proj:wkt2, proj:code, proj:projjson for CRS reading
  • Support spatial:transform, spatial:dimensions for transform and dimension reading

Reviewer feedback addressed:

  • ✅ Both conventions are attempted when reading regardless of setting (priority changes only)
  • ✅ Use CRS.from_user_input() instead of explicit PROJJSON handling
  • ✅ Use functional test format, not class format
  • ✅ Imports at top of file

- Introduced a new `Convention` enum for managing geospatial metadata conventions.
- Added CF convention support in the `_convention` module with functions for reading and writing CRS and transforms.
- Updated `_options` to include a convention option.
- Modified `XRasterBase` to utilize the convention setting for spatial dimension detection and CRS handling.
- Implemented unit tests for CF convention functionalities and options.
…tion logic to `_convention/cf.py` module

DOC: Update documentation to include `rioxarray.enum` module with members and inheritance
This is the first in a series of PRs splitting corteva#883 as requested by maintainers.

**Changes:**
- Add `Convention` enum with `CF` value
- Add `convention` option to `set_options()`
- Create cf.py module with extracted CF read/write logic
- Refactor rioxarray.py to use the new CF module

This PR establishes the framework for supporting multiple geospatial metadata conventions. Future PRs will add Zarr convention support.

---

- [ ] Closes corteva#883 (partial - first of series)
- [x] Tests added
- [] Fully documented, including history.rst for all changes and rioxarray.rst for new API
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.

1 participant