Skip to content

Commit 2ae1874

Browse files
Merge pull request #6 from stac-extensions/linkrender
Adds render cross reference in links
2 parents 13ae5c5 + 24dc549 commit 2ae1874

File tree

4 files changed

+146
-15
lines changed

4 files changed

+146
-15
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11+
- Adds render cross reference in links ([#2](https://github.com/stac-extensions/render/issues/2))
12+
1113
### Changed
1214

1315
### Deprecated

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,22 @@ It is highly suggested to have a web map link in the `links` section of the STAC
225225
[Web Map Link extension](https://github.com/stac-extensions/web-map-links) to allow application to
226226
find the tiling endpoint of the dynamic tile server.
227227

228+
### Additional Attributes
229+
230+
A [web map link](https://github.com/stac-extensions/web-map-links) can be extended with the attribute `render`
231+
with a value corresponding to the key of the render object in the `renders` field
232+
in order to provide a cross link to the render object.
233+
234+
```json
235+
{
236+
"rel": "xyz",
237+
"type": "image/png",
238+
"title": "NDVI",
239+
"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",
240+
"render": "ndvi"
241+
}
242+
```
243+
228244
## Contributing
229245

230246
All contributions are subject to the

examples/item-landsat8.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"https://stac-extensions.github.io/projection/v1.0.0/schema.json",
77
"https://stac-extensions.github.io/view/v1.0.0/schema.json",
88
"https://stac-extensions.github.io/render/v1.0.0/schema.json",
9-
"https://stac-extensions.github.io/virtual-assets/v1.0.0/schema.json"
9+
"https://stac-extensions.github.io/virtual-assets/v1.0.0/schema.json",
10+
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
1011
],
1112
"id": "LC08_L1TP_044033_20210305_20210312_01_T1",
1213
"properties": {
@@ -102,6 +103,19 @@
102103
"type": "image/png",
103104
"title": "RGB composite visualized through a XYZ"
104105
},
106+
{
107+
"rel": "xyz",
108+
"type": "image/png",
109+
"title": "NDVI",
110+
"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",
111+
"render": "ndvi"
112+
},
113+
{
114+
"rel": "xyz",
115+
"type": "image/png",
116+
"title": "NDVI",
117+
"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"
118+
},
105119
{
106120
"rel": "collection",
107121
"href": "https://landsat-stac.s3.amazonaws.com/collections/landsat-8-l1.json",

json-schema/schema.json

Lines changed: 113 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,37 @@
3434
}
3535
}
3636
}
37+
},
38+
{
39+
"if": {
40+
"properties": {
41+
"stac_extensions": {
42+
"contains": {
43+
"type": "string",
44+
"pattern": "https:\/\/stac-extensions\\.github\\.io\/web-map-links\/.*"
45+
}
46+
}
47+
}
48+
},
49+
"then": {
50+
"properties": {
51+
"links": {
52+
"type": "array",
53+
"contains": {
54+
"type": "object",
55+
"required": [
56+
"rel",
57+
"render"
58+
],
59+
"properties": {
60+
"render": {
61+
"type": "string"
62+
}
63+
}
64+
}
65+
}
66+
}
67+
}
3768
}
3869
]
3970
},
@@ -60,8 +91,18 @@
6091
{
6192
"$comment": "This validates the fields in Collection Assets, but does not require them.",
6293
"anyOf": [
63-
{"type": "object", "required": ["assets"]},
64-
{"type": "object", "required": ["item_assets"]}
94+
{
95+
"type": "object",
96+
"required": [
97+
"assets"
98+
]
99+
},
100+
{
101+
"type": "object",
102+
"required": [
103+
"item_assets"
104+
]
105+
}
65106
],
66107
"properties": {
67108
"renders": {
@@ -104,17 +145,72 @@
104145
"require_any_field": {
105146
"$comment": "Please list all fields here so that we can force the existence of one of them in other parts of the schemas.",
106147
"anyOf": [
107-
{"type": "object", "required": ["assets"]},
108-
{"type": "object", "required": ["title"]},
109-
{"type": "object", "required": ["rescale"]},
110-
{"type": "object", "required": ["nodata"]},
111-
{"type": "object", "required": ["colormap_name"]},
112-
{"type": "object", "required": ["colormap"]},
113-
{"type": "object", "required": ["color_formula"]},
114-
{"type": "object", "required": ["resampling"]},
115-
{"type": "object", "required": ["expression"]},
116-
{"type": "object", "required": ["minmax_zoom"]},
117-
{"type": "object", "required": ["bidx"]}
148+
{
149+
"type": "object",
150+
"required": [
151+
"assets"
152+
]
153+
},
154+
{
155+
"type": "object",
156+
"required": [
157+
"title"
158+
]
159+
},
160+
{
161+
"type": "object",
162+
"required": [
163+
"rescale"
164+
]
165+
},
166+
{
167+
"type": "object",
168+
"required": [
169+
"nodata"
170+
]
171+
},
172+
{
173+
"type": "object",
174+
"required": [
175+
"colormap_name"
176+
]
177+
},
178+
{
179+
"type": "object",
180+
"required": [
181+
"colormap"
182+
]
183+
},
184+
{
185+
"type": "object",
186+
"required": [
187+
"color_formula"
188+
]
189+
},
190+
{
191+
"type": "object",
192+
"required": [
193+
"resampling"
194+
]
195+
},
196+
{
197+
"type": "object",
198+
"required": [
199+
"expression"
200+
]
201+
},
202+
{
203+
"type": "object",
204+
"required": [
205+
"minmax_zoom"
206+
]
207+
},
208+
{
209+
"type": "object",
210+
"required": [
211+
"bidx"
212+
]
213+
}
118214
]
119215
},
120216
"fields": {
@@ -143,7 +239,10 @@
143239
}
144240
},
145241
"nodata": {
146-
"type": ["number","string"]
242+
"type": [
243+
"number",
244+
"string"
245+
]
147246
},
148247
"colormap_name": {
149248
"type": "string"

0 commit comments

Comments
 (0)