pystac
pystac copied to clipboard
Add "inheritence"
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
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.
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?