pystac icon indicating copy to clipboard operation
pystac copied to clipboard

Add "inheritence"

Open gadomski opened this issue 2 years ago • 2 comments

In STAC 1.1, we are probably going to explicitly state that assets "inherit" attributes from items. E.g., for this (shortened) item:

{
  "properties": {"foo": "bar"},
  "assets": {"data": {"href": "example.tif"}}
}

pystac should behave like this:

assert item.assets["data"].foo == "bar"

This might require some strange __getattr__ magic, which might be really hard to do while preserving typing.

Related issues

  • Came out of discussions on https://github.com/radiantearth/stac-spec/discussions/1213

gadomski avatar Sep 27 '23 19:09 gadomski

Items don't have this kind of arbitrary get logic though right? So it might be that we add a bunch of new properties to the Asset class.

jsignell avatar Sep 28 '23 13:09 jsignell

So it might be that we add a bunch of new properties to the Asset class.

Yup, agreed ... and, as I was thinking about it this morning, maybe Band as well -- I think the way the bands RFC works, an attribute could be defined on a band, on an asset, or on an item?

gadomski avatar Sep 28 '23 13:09 gadomski