stac-utils / pystac

Python library for working with any SpatioTemporal Asset Catalog (STAC)

Home Page:https://pystac.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `Asset.bands`

gadomski opened this issue · comments

To support the implementation of radiantearth/stac-spec#1213, we need to add support for the bands attribute on assets. This attribute should be a list of band objects, and each band object should have accessors for its spec-defined attributes. These accessors should look up the attribute value in the band, then in the asset, then in the item, in a "fall-up" mechanism. This is similar to how extensions currently "fall-up" to find their values:

if asset.owner and isinstance(asset.owner, pystac.Item):
self.additional_read_properties = [asset.owner.properties]

After discussion at the STAC sprint, our initial implementation plan is:

  • Abstract the current behavior, implemented in extensions, to fall back to item properties if the given property isn't present on an asset or band
  • Create a Bands class that extends the new abstracted behavior
  • Add bands to Asset
  • Refactor all extensions to use the new abstracted behavior

This may require close coordination with any resolutions proposed to #448, e.g. #1051.

Twists

  • Some attributes should not "fall-up", e.g. "created" ... do we need to handle this?