GeoscienceAustralia / dea-notebooks

Repository for Digital Earth Australia Jupyter Notebooks: tools and workflows for geospatial analysis with Open Data Cube and Xarray
https://docs.dea.ga.gov.au/notebooks/
Apache License 2.0
435 stars 128 forks source link

Refactor `dea_tools.classification` functions to use `odc.geo` #1076

Open robbibt opened 1 year ago

robbibt commented 1 year ago

Currently, functions from dea_tools.classification access spatial information about datacube-loaded data using the .geobox extension, and geometry tools from datacube.utils.geometry.

In ODC version 1.9 and above, these tools will be deprecated and replaced with odc.geo (see https://github.com/opendatacube/datacube-core/pull/1424).

To future proof our classification/ML tools, we should update our functions to use replacement functionality from odc.geo. For example, accessing spatial information like:

ds.odc.geobox

And geometry tools like:

from odc.geo.geom import Geometry
from odc.geo.xr import assign_crs

# or simply
ds.odc.assign_crs()

https://odc-geo.readthedocs.io/en/latest/api.html

Related issue: https://github.com/GeoscienceAustralia/dea-notebooks/issues/1038

robbibt commented 1 year ago

This is likely a job to do after we have functioning unit tests, e.g. #1075