You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@clausmichele can you please provide more details about how and where you are running code and what version of datacube you are using.
Also what happens when you do this print(your_dataset.geobox) ?
.geobox is a dynamic property computed from crs data stored in special way inside xarray dataset/dataarray. We have recently changed the location of that data. It used to be stored as an attribute of the dataset and dataarray object, but that was too easy to lose when performing operations on loaded data. Newer versions of datacube create an extra coordinate with CRS metadata, judging by your printout you are using older version of datacube, and your dataset does have .crs attribute and so I would expect .geobox to return a valid object.
My fault sorry, it is indeed returning a valid object on a loaded dataset, maybe I missed something when I was trying yesterday.
On the other hand, if I store the same dataset to a netcdf file with write_dataset_to_netcdf(dataset,'path'), imported from datacube.drivers.netcdf, and then I load it again with dataset = xarray.open_dataset('path') I can't use the .geobox attribute anymore. I see now that this last part was already tracked in this issue, so I'll close this.
Thanks for the support!
The Polygon Drill Example assumes that loaded data has the attribute geobox, which is not present in my case with Sentinel-2 data loaded with ODC:
How to apply polygon drill using the provided code?
The text was updated successfully, but these errors were encountered: