opendatacube / odc-geo

GeoBox and geometry utilities extracted from datacube-core
https://odc-geo.readthedocs.io/en/latest/
Apache License 2.0
83 stars 15 forks source link

Feature request: reprojection for `xr.Dataset` as well as `xr.DataArray` #66

Closed robbibt closed 2 years ago

robbibt commented 2 years ago

Currently, only the odc.geo.xr.ODCExtensionDa ODC extension has a .reproject method:

https://odc-geo.readthedocs.io/en/latest/_api/odc.geo.xr.ODCExtensionDa.html#odc.geo.xr.ODCExtensionDa https://odc-geo.readthedocs.io/en/latest/_api/odc.geo.xr.ODCExtensionDs.html#odc.geo.xr.ODCExtensionDs

However, users of ODC often load EO imagery with multiple spectral bands as a single xr.Dataset containing multiple variables.

Because of this, it would be very useful to be able to reproject an entire xr.Dataset using odc.geo so that users can transform their entire dataset in one pass, rather than having to convert each individual xr.DataArray seperately.

I believe this makes logical sense as individual variables in an xr.Dataset usually share the same overall coordinates/GeoBox. However, I can see this being problematic when a user has added additional variables to their dataset (e.g. 1D data with only time coords etc) - perhaps any variables that don't fit the GeoBox model could be skipped during the reproject (or an error raised)?

Kirill888 commented 2 years ago

This is clearly an omission, reproject on a dataset should be supported as well.