-
Notifications
You must be signed in to change notification settings - Fork 183
Description
Recently, some people approached me asking to provide related links to individual assets.
Usecases:
- add more processing:expression examples for python, docker and generic URI stac-extensions/processing#33
- Provide a visualization (flat style file) for each asset
- ...
I'm wondering what the best solution for this is:
- Individual properties that just contains a URL
- Have a links arrays as defined in STAC also in Assets
- 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"]
}
]
}