Skip to content

Commit

Permalink
Merge pull request #6 from stac-extensions/linkrender
Browse files Browse the repository at this point in the history
Adds render cross reference in links
  • Loading branch information
emmanuelmathot authored Jun 13, 2024
2 parents 13ae5c5 + 24dc549 commit 2ae1874
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Adds render cross reference in links ([#2](https://github.com/stac-extensions/render/issues/2))

### Changed

### Deprecated
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,22 @@ It is highly suggested to have a web map link in the `links` section of the STAC
[Web Map Link extension](https://github.com/stac-extensions/web-map-links) to allow application to
find the tiling endpoint of the dynamic tile server.

### Additional Attributes

A [web map link](https://github.com/stac-extensions/web-map-links) can be extended with the attribute `render`
with a value corresponding to the key of the render object in the `renders` field
in order to provide a cross link to the render object.

```json
{
"rel": "xyz",
"type": "image/png",
"title": "NDVI",
"href": "https://api.cogeo.xyz/stac/preview.png?url=https://raw.githubusercontent.com/stac-extensions/raster/main/examples/item-landsat8.json&expression=(B5–B4)/(B5+B4)&max_size=512&width=512&resampling_method=average&rescale=-1,1&color_map=ylgn&return_mask=true",
"render": "ndvi"
}
```

## Contributing

All contributions are subject to the
Expand Down
16 changes: 15 additions & 1 deletion examples/item-landsat8.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"https://stac-extensions.github.io/projection/v1.0.0/schema.json",
"https://stac-extensions.github.io/view/v1.0.0/schema.json",
"https://stac-extensions.github.io/render/v1.0.0/schema.json",
"https://stac-extensions.github.io/virtual-assets/v1.0.0/schema.json"
"https://stac-extensions.github.io/virtual-assets/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
],
"id": "LC08_L1TP_044033_20210305_20210312_01_T1",
"properties": {
Expand Down Expand Up @@ -102,6 +103,19 @@
"type": "image/png",
"title": "RGB composite visualized through a XYZ"
},
{
"rel": "xyz",
"type": "image/png",
"title": "NDVI",
"href": "https://api.cogeo.xyz/stac/preview.png?url=https://raw.githubusercontent.com/stac-extensions/raster/main/examples/item-landsat8.json&expression=(B5–B4)/(B5+B4)&max_size=512&width=512&resampling_method=average&rescale=-1,1&color_map=ylgn&return_mask=true",
"render": "ndvi"
},
{
"rel": "xyz",
"type": "image/png",
"title": "NDVI",
"href": "https://api.cogeo.xyz/stac/preview.png?url=https://raw.githubusercontent.com/stac-extensions/raster/main/examples/item-landsat8.json&expression=(B5–B4)/(B5+B4)&max_size=512&width=512&resampling_method=average&rescale=-1,1&color_map=ylgn&return_mask=true"
},
{
"rel": "collection",
"href": "https://landsat-stac.s3.amazonaws.com/collections/landsat-8-l1.json",
Expand Down
127 changes: 113 additions & 14 deletions json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,37 @@
}
}
}
},
{
"if": {
"properties": {
"stac_extensions": {
"contains": {
"type": "string",
"pattern": "https:\/\/stac-extensions\\.github\\.io\/web-map-links\/.*"
}
}
}
},
"then": {
"properties": {
"links": {
"type": "array",
"contains": {
"type": "object",
"required": [
"rel",
"render"
],
"properties": {
"render": {
"type": "string"
}
}
}
}
}
}
}
]
},
Expand All @@ -60,8 +91,18 @@
{
"$comment": "This validates the fields in Collection Assets, but does not require them.",
"anyOf": [
{"type": "object", "required": ["assets"]},
{"type": "object", "required": ["item_assets"]}
{
"type": "object",
"required": [
"assets"
]
},
{
"type": "object",
"required": [
"item_assets"
]
}
],
"properties": {
"renders": {
Expand Down Expand Up @@ -104,17 +145,72 @@
"require_any_field": {
"$comment": "Please list all fields here so that we can force the existence of one of them in other parts of the schemas.",
"anyOf": [
{"type": "object", "required": ["assets"]},
{"type": "object", "required": ["title"]},
{"type": "object", "required": ["rescale"]},
{"type": "object", "required": ["nodata"]},
{"type": "object", "required": ["colormap_name"]},
{"type": "object", "required": ["colormap"]},
{"type": "object", "required": ["color_formula"]},
{"type": "object", "required": ["resampling"]},
{"type": "object", "required": ["expression"]},
{"type": "object", "required": ["minmax_zoom"]},
{"type": "object", "required": ["bidx"]}
{
"type": "object",
"required": [
"assets"
]
},
{
"type": "object",
"required": [
"title"
]
},
{
"type": "object",
"required": [
"rescale"
]
},
{
"type": "object",
"required": [
"nodata"
]
},
{
"type": "object",
"required": [
"colormap_name"
]
},
{
"type": "object",
"required": [
"colormap"
]
},
{
"type": "object",
"required": [
"color_formula"
]
},
{
"type": "object",
"required": [
"resampling"
]
},
{
"type": "object",
"required": [
"expression"
]
},
{
"type": "object",
"required": [
"minmax_zoom"
]
},
{
"type": "object",
"required": [
"bidx"
]
}
]
},
"fields": {
Expand Down Expand Up @@ -143,7 +239,10 @@
}
},
"nodata": {
"type": ["number","string"]
"type": [
"number",
"string"
]
},
"colormap_name": {
"type": "string"
Expand Down

0 comments on commit 2ae1874

Please sign in to comment.