radiantearth / stac-spec

SpatioTemporal Asset Catalog specification - making geospatial assets openly searchable and crawlable
https://stacspec.org
Apache License 2.0
790 stars 179 forks source link

Should `item_assets` be required in core? #1311

Closed aznan2 closed 2 months ago

aznan2 commented 2 months ago

Having the field item_assets be required i collections makes sense when Item Assets is its own extension, but if it is required in core I can see some possible issues. The field works well when the collection is of a set of homogeneous data, but questions arise of what happens when the data is gathered from disparate sources - perhaps from different users posting in items to a server that implements the Transaction extension. For example, what happens if users add two items with the following assets:

"assets": {
  "image": {
    "title": "Image",
    "description": "The image",
    "href": "...",
    "type": "image/tiff",
    "roles": ["data"]
  },
  "thumb": {
    "title": "Thumbnail",
    "description": "A thumbnail image",
    "href": "...",
    "type": "image/tiff",
    "roles": ["thumbnail"]
  }
}

"assets": {
  "image": {
    "title": "The City",
    "description": "Satelite image over The City",
    "href": "...",
    "type": "image/png",
    "roles": ["data"]
  },
  "image-small": {
    "title": "The City",
    "description": "Same, but the houses are tiny",
    "href": "...",
    "type": "image/png",
    "roles": ["thumbnail"]
  }
}

In this case, in item_assets, what should the title of the image key be? And since it may be difficult to control what keys the users use, as with the thumbnail in this example, the map may potentially grow very large.

m-mohr commented 2 months ago

Good catch, thanks. item_assets is not meant to be required, it is a copy&paste mistake on our end, just in the written Markdown documentation. The JSON schema doesn't enforce item_assets fortunately. See PR #1314