-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Labels
proposalIdea for a new feature.Idea for a new feature.
Description
Discussion: How to apply spatial indexes in rioxarray
Related:
- https://github.com/xarray-contrib/xproj
- https://github.com/xarray-contrib/rasterix
- Experimentally support CRSIndex #588
- Generate spatial coords with rasterix.RasterIndex #855
- Add raster index #846
- https://xdggs.readthedocs.io/en/latest/user_guide/conventions.html
Current method for applying indexes:
ds_raster_zarr = xr.open_dataset("store.zarr")
# build xarray indexes from Zarr/CF conventions
ds_raster_idx = (
ds_raster_zarr
.set_xindex("crs", xproj.CRSIndex, crs=ds_raster_zarr.rio.crs)
.assign_coords(xarray.Coordinates.from_xindex(rasterix.RasterIndex.from_transform(ds_raster_zarr.rio.transform()))
)
# use xarray geospatial indexes
ds_result = (
ds_raster_idx
.isel(x=..., y=...)
...
)Challenges:
- Metadata from other conventions may become invalid/conflict when performing xarray operations (DataArray Inheritance from Parent Dataset for Zarr Conventions #888 (comment)).
Potential strategy:
- Stage 1: Read only support & provide examples for writing spatial indexes
- Stage 2: Write support
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
proposalIdea for a new feature.Idea for a new feature.