A group of us (@benbovy, @scottyhq,@maxrjones, and I) have put together a new RasterIndex that allows indexing using the affine transform. It lives in this new rasterix project and is ready for experimentation. It creates lazy coordinate variables under the hood — that is the values are generated on-demand; and supports some forms of alignment, and concatenation using the underlying transforms, NOT the coordinate values. For CRS handling, it composes with xproj.CRSIndex and satisfies xproj’s extension API.
The code is alpha-quality — our priority was to build something that could be experimented with, and that would guide design choices around Xarray’s indexing API. Thus we’ve had to make some choices, not all of which are optimal and are worthy of discussion (please speak up!).
A very cool aspect is that this Index is built on a CoordinateTransformIndex class provided by Xarray, with the coordinate transform described by a CoordinateTransform class. As you can see, Xarray’s goal here is to make it easy to build such indexes :).
Please try it out and let us know what you think. Our hope is that this project will provide a nice composable piece that works well with existing efforts in the space (e.g. rioxarray
, odc.geo
, etc).