stac-extensions / raster

Describes raster assets at band level (one or multiple) with specific information such as data type, unit, number of bits used, nodata.
Apache License 2.0
13 stars 7 forks source link

Duplication? #22

Closed m-mohr closed 1 year ago

m-mohr commented 3 years ago

Is there a recommended way to handle excessive duplication, e.g. if all bands have the same semantics?

For example, we generate something like that right now:


      "raster:bands": [
        {
          "nodata": 0,
          "data_type": "int16",
          "unit": "fraction"
        },
        {
          "nodata": 0,
          "data_type": "int16",
          "unit": "fraction"
        },
        {
          "nodata": 0,
          "data_type": "int16",
          "unit": "fraction"
        },
        {
          "nodata": 0,
          "data_type": "int16",
          "unit": "fraction"
        },
        {
          "nodata": 0,
          "data_type": "int16",
          "unit": "fraction"
        },
        {
          "nodata": 0,
          "data_type": "int16",
          "unit": "fraction"
        },
        {
          "nodata": 0,
          "data_type": "int16",
          "unit": "fraction"
        },
        {
          "nodata": 0,
          "data_type": "int16",
          "unit": "fraction"
        },
        {
          "nodata": 0,
          "data_type": "int16",
          "unit": "fraction"
        },
        {
          "nodata": 0,
          "data_type": "int16",
          "unit": "fraction"
        }
      ],
matthewhanson commented 3 years ago

One of the reasons why I liked the idea of being able to specify all these fields directly on the asset, then having the raster:bands construct be able to specify any asset field per band, this would handle the addition of 'description' as well. So if you had the same nodata it would just be raster:nodata on the asset, but with more than one band it would be in the raster:bands array. It would also allow fields from other extensions like "proj:shape" to be defined per band, since some formats do allow differing resolutions across bands (e.g., hdf). Basically this seemed like a natural extension of the common metadata model where you can have fields defined per-Item, per-Asset, or per-Band.

In lieu of the above approach, which would require a major version update or even a new extension, I'm not sure of a good way to do this with the extension as is.

emmanuelmathot commented 2 years ago

could we simply allow the raster band properties to be at asset level as they would apply to all bands. On the other hand, let's keep discussing about a new wider core concept of band applicable to all extensions

emmanuelmathot commented 1 year ago

Discussed in STAC sprint and this is up to implementation (e.g. hydration in pg-stac)