odc.stac.stac2ds

odc.stac.stac2ds(items, cfg=None, product_cache=None)[source]

STAC Item to Dataset stream converter.

Given a lazy sequence of STAC Item objects turn it into a lazy sequence of Dataset objects.

Assumptions

First observed Item for a given collection is used to construct datacube product definition. After that, all subsequent items from the same collection are interpreted according to that product spec. Specifically this means that every item is expected to have the same set of bands. If product contains bands with different resolutions, it is assumed that the same set of bands share common resolution across all items in the collection.

Parameters
sentinel-2-l2a:  # < name of the collection, i.e. `.collection_id`
  assets:
    "*":  # Band named "*" contains band info for "most" bands
      data_type: uint16
      nodata: 0
      unit: "1"
    SCL:  # Those bands that are different than "most"
      data_type: uint8
      nodata: 0
      unit: "1"
  aliases:  #< unique alias -> canonical map
    rededge: B05
    rededge1: B05
    rededge2: B06
    rededge3: B07
  uuid:          # Rules for constructing UUID for Datasets
    mode: auto   # auto|random|native(expect .id to contain valid UUID string)
    extras:      # List of extra keys from properties to include (mode=auto)
    - "s2:generation_time"

  warnings: ignore  # ignore|all  (default all)

some-other-collection:
  assets:
  #...

"*": # Applies to all collections if not defined on a collection
  warnings: ignore
Return type

Iterator[Dataset]