Open
Description
I wonder if it would be in scope for the xvec
accessor to have a method that can be used to convert two bounds coordinates to shapely
geometry columns?
I'd imagine something like this:
import xarray as xr
import cf_xarray
import xvec
ds = (
xr.tutorial.open_dataset("air_temperature", chunks={})
.cf.add_bounds(["lat", "lon"])
.xvec.bounds_to_shapely(["lat_bounds", "lon_bounds"])
)
That would require xvec
to broadcast or stack lat
and lon
, so we might also require doing that first (but ideally, we'd support 2D geometry variables):
ds = (
xr.tutorial.open_dataset("air_temperature", chunks={})
.cf.add_bounds(["lat", "lon"])
.stack(cells=["lat", "lon"])
.xvec.bounds_to_shapely(["lat_bounds", "lon_bounds"])
)
Metadata
Metadata
Assignees
Labels
No labels