Skip to content

Commit

Permalink
Extract GeoBox Dataset->RasterSource
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill888 committed Jun 25, 2024
1 parent 50ff6fb commit 2f8cf31
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions datacube/storage/_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
from . import BandInfo


def ds_geobox(ds: Dataset, **kw) -> GeoBox | None:
from ..testutils.io import eo3_geobox

try:
return eo3_geobox(ds, **kw)
except ValueError:
return None


def _extract_coords(extra_dims: ExtraDimensions) -> list[FixedCoord]:
coords = extra_dims.dims

Expand Down Expand Up @@ -127,6 +136,7 @@ def _ds_extract(ds: Dataset) -> dict[str, RasterSource]:
patch_url(bi.uri),
band=band_idx,
subdataset=bi.layer,
geobox=ds_geobox(ds, band=n),
meta=template.bands[(n, band_idx or 1)],
driver_data=bi.driver_data,
)
Expand Down

0 comments on commit 2f8cf31

Please sign in to comment.