Skip to content

Commit edaeaed

Browse files
Adds render cross reference in links
This PR Adds render cross reference in links and fix #2
1 parent 9b57094 commit edaeaed

File tree

4 files changed

+147
-16
lines changed

4 files changed

+147
-16
lines changed

CHANGELOG.md

+2
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

+16
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,22 @@ It is highly suggested to have a web map link in the `links` section of the STAC
218218
[Web Map Link extension](https://github.com/stac-extensions/web-map-links) to allow application to
219219
find the tiling endpoint of the dynamic tile server.
220220

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

223239
All contributions are subject to the

examples/item-landsat8.json

+15-1
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": {
@@ -66,6 +67,19 @@
6667
"type": "image/png",
6768
"title": "RGB composite visualized through a XYZ"
6869
},
70+
{
71+
"rel": "xyz",
72+
"type": "image/png",
73+
"title": "NDVI",
74+
"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",
75+
"render": "ndvi"
76+
},
77+
{
78+
"rel": "xyz",
79+
"type": "image/png",
80+
"title": "NDVI",
81+
"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"
82+
},
6983
{
7084
"rel": "collection",
7185
"href": "https://landsat-stac.s3.amazonaws.com/collections/landsat-8-l1.json",

json-schema/schema.json

+114-15
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,37 @@
2929
}
3030
}
3131
}
32+
},
33+
{
34+
"if": {
35+
"properties": {
36+
"stac_extensions": {
37+
"contains": {
38+
"type": "string",
39+
"pattern": "https:\/\/stac-extensions\\.github\\.io\/web-map-links\/.*"
40+
}
41+
}
42+
}
43+
},
44+
"then": {
45+
"properties": {
46+
"links": {
47+
"type": "array",
48+
"contains": {
49+
"type": "object",
50+
"required": [
51+
"rel",
52+
"render"
53+
],
54+
"properties": {
55+
"render": {
56+
"type": "string"
57+
}
58+
}
59+
}
60+
}
61+
}
62+
}
3263
}
3364
]
3465
},
@@ -55,8 +86,18 @@
5586
{
5687
"$comment": "This validates the fields in Collection Assets, but does not require them.",
5788
"anyOf": [
58-
{"type": "object", "required": ["assets"]},
59-
{"type": "object", "required": ["item_assets"]}
89+
{
90+
"type": "object",
91+
"required": [
92+
"assets"
93+
]
94+
},
95+
{
96+
"type": "object",
97+
"required": [
98+
"item_assets"
99+
]
100+
}
60101
],
61102
"properties": {
62103
"renders": {
@@ -99,17 +140,72 @@
99140
"require_any_field": {
100141
"$comment": "Please list all fields here so that we can force the existence of one of them in other parts of the schemas.",
101142
"anyOf": [
102-
{"type": "object", "required": ["assets"]},
103-
{"type": "object", "required": ["title"]},
104-
{"type": "object", "required": ["rescale"]},
105-
{"type": "object", "required": ["nodata"]},
106-
{"type": "object", "required": ["colormap_name"]},
107-
{"type": "object", "required": ["colormap"]},
108-
{"type": "object", "required": ["color_formula"]},
109-
{"type": "object", "required": ["resampling"]},
110-
{"type": "object", "required": ["expression"]},
111-
{"type": "object", "required": ["minmax_zoom"]},
112-
{"type": "object", "required": ["bidx"]}
143+
{
144+
"type": "object",
145+
"required": [
146+
"assets"
147+
]
148+
},
149+
{
150+
"type": "object",
151+
"required": [
152+
"title"
153+
]
154+
},
155+
{
156+
"type": "object",
157+
"required": [
158+
"rescale"
159+
]
160+
},
161+
{
162+
"type": "object",
163+
"required": [
164+
"nodata"
165+
]
166+
},
167+
{
168+
"type": "object",
169+
"required": [
170+
"colormap_name"
171+
]
172+
},
173+
{
174+
"type": "object",
175+
"required": [
176+
"colormap"
177+
]
178+
},
179+
{
180+
"type": "object",
181+
"required": [
182+
"color_formula"
183+
]
184+
},
185+
{
186+
"type": "object",
187+
"required": [
188+
"resampling"
189+
]
190+
},
191+
{
192+
"type": "object",
193+
"required": [
194+
"expression"
195+
]
196+
},
197+
{
198+
"type": "object",
199+
"required": [
200+
"minmax_zoom"
201+
]
202+
},
203+
{
204+
"type": "object",
205+
"required": [
206+
"bidx"
207+
]
208+
}
113209
]
114210
},
115211
"fields": {
@@ -138,7 +234,10 @@
138234
}
139235
},
140236
"nodata": {
141-
"type": ["number","string"]
237+
"type": [
238+
"number",
239+
"string"
240+
]
142241
},
143242
"colormap_name": {
144243
"type": "string"
@@ -161,7 +260,7 @@
161260
"type": "number"
162261
}
163262
},
164-
"bidx":{
263+
"bidx": {
165264
"type": "array",
166265
"items": {
167266
"type": "number"

0 commit comments

Comments
 (0)