diff --git a/CHANGELOG.md b/CHANGELOG.md index c5f8a2f..0165690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index b53542a..d2a55a1 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/examples/item-landsat8.json b/examples/item-landsat8.json index 1f6d9dd..576a01f 100644 --- a/examples/item-landsat8.json +++ b/examples/item-landsat8.json @@ -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": { @@ -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", diff --git a/json-schema/schema.json b/json-schema/schema.json index 22231ff..2f74f94 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -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" + } + } + } + } + } + } } ] }, @@ -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": { @@ -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": { @@ -143,7 +239,10 @@ } }, "nodata": { - "type": ["number","string"] + "type": [ + "number", + "string" + ] }, "colormap_name": { "type": "string"