Skip to content

Links per asset #1284

@m-mohr

Description

@m-mohr

Recently, some people approached me asking to provide related links to individual assets.

Usecases:

I'm wondering what the best solution for this is:

  1. Individual properties that just contains a URL
  2. Have a links arrays as defined in STAC also in Assets
  3. Add it to the global links array and have a property that identifies which asset it belongs to via the asset key

Looking for opinions and feedback.

Example 1

Drawback is, you can't really provide additional information about the link, e.g. media type.

{
   "assets":{
      "href":"features.geojson",
      "type":"application/geo+json",
      "style":"style.cfg"
   }
}

Example 2

Note: File format, media type an rel type are examples and probably don't exist.

Existing tooling may not understand this, but it re-uses an existing structure and the links are close to the assets.

{
   "assets":{
      "example":{
         "href":"features.geojson",
         "type":"application/geo+json",
         "links":[
            {
               "href":"style.cfg",
               "type":"text/vector-styles",
               "rel":"style"
            }
         ]
      }
   }
}

Example 3A

Note: File format, media type an rel type are examples and probably don't exist.

This works the best with existing tooling, but the information are not close together. It's a little harder to implement as you need to filter the links for each asset.

{
   "assets":{
      "example":{
         "href":"features.geojson",
         "type":"application/geo+json"
      }
   },
   "links":[
      {
         "href":"style.cfg",
         "type":"text/vector-styles",
         "rel":"style",
         "asset":"example"
      }
   ]
}

Example 3B

Potentially this could allow assigning a link to multiple assets if we slightly change it. This could allow a bit of de-duplication:

{
   "assets":{
      "example":{
         "href":"features.geojson",
         "type":"application/geo+json"
      },
      "example2":{
         "href":"features2.geojson",
         "type":"application/geo+json"
      },
      "example3":{
         "href":"features2.tif",
         "type":"image/tiff"
      }
   },
   "links":[
      {
         "href":"style.cfg",
         "type":"text/vector-styles",
         "rel":"style",
         "asset:keys": ["example", "example2"]
      }
   ]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions