Skip to content

ENH: Spatial Indexes #908

Description

@snowman2

Discussion: How to apply spatial indexes in rioxarray

Related:

Current method for applying indexes:

#888 (comment)

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:

Potential strategy:

  • Stage 1: Read only support & provide examples for writing spatial indexes
  • Stage 2: Write support

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalIdea for a new feature.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions