Skip to content

Commit 24dc549

Browse files
Merge remote-tracking branch 'origin/main' into linkrender
2 parents edaeaed + 13ae5c5 commit 24dc549

File tree

5 files changed

+107
-93
lines changed

5 files changed

+107
-93
lines changed

CHANGELOG.md

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

1919
### Fixed
2020

21+
- Place 'renders' object in Item properties [#4](https://github.com/stac-extensions/render/issues/4)
22+
2123
[Unreleased]: <https://github.com/stac-extensions/render/compare/v1.0.0...HEAD>

README.md

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,15 @@ by simply specifying the `url` and `assets` query parameters.
120120
From the [Sentinel-2 item](https://github.com/stac-extensions/virtual-assets/blob/main/examples/item-sentinel2.json):
121121

122122
```json
123-
"renders":{
124-
"sir":
125-
{
126-
"title": "Shortwave Infra-red",
127-
"assets": [ "swir22", "nir2", "red" ],
128-
"rescale": [[0,5000],[0,7000],[0,9000]],
129-
"resampling": "nearest"
123+
"properties":{
124+
"renders":{
125+
"sir":
126+
{
127+
"title": "Shortwave Infra-red",
128+
"assets": [ "swir22", "nir2", "red" ],
129+
"rescale": [[0,5000],[0,7000],[0,9000]],
130+
"resampling": "nearest"
131+
}
130132
}
131133
}
132134
```
@@ -167,15 +169,18 @@ the NDVI asset could also be downloaded as a standalone asset.
167169
},
168170
}
169171
},
170-
"renders":{
171-
"ndvi":
172-
{
173-
"title": "Normalized Difference Vegetation Index",
174-
"assets": [ "ndvi" ],
175-
"resampling": "average",
176-
"colormap_name": "ylgn"
172+
"properties":{
173+
"renders":{
174+
"ndvi":
175+
{
176+
"title": "Normalized Difference Vegetation Index",
177+
"assets": [ "ndvi" ],
178+
"resampling": "average",
179+
"colormap_name": "ylgn"
180+
}
177181
}
178182
}
183+
179184
```
180185

181186
If this case, the parameters to titiler must be extracted from both the virtual asset definition and the render object.
@@ -199,15 +204,17 @@ Result: Landsat Surface Reflectance Normalized Difference Vegetation Index (NDV
199204
Obviously, the same rendering can be applied to local source assets without using the virtual asset.
200205

201206
```json
202-
"renders":{
203-
"ndvi":
204-
{
205-
"title": "Normalized Difference Vegetation Index",
206-
"assets": [ "B05", "B04" ],
207-
"resampling": "average",
208-
"colormap_name": "ylgn",
209-
"expression": "(B05–B04)/(B05+B04)",
210-
"rescale": [[-1,1]]
207+
"properties":{
208+
"renders":{
209+
"ndvi":
210+
{
211+
"title": "Normalized Difference Vegetation Index",
212+
"assets": [ "B05", "B04" ],
213+
"resampling": "average",
214+
"colormap_name": "ylgn",
215+
"expression": "(B05–B04)/(B05+B04)",
216+
"rescale": [[-1,1]]
217+
}
211218
}
212219
}
213220
```

examples/item-landsat8.json

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,43 @@
3131
"landsat:wrs_row": "33",
3232
"datetime": "2021-03-05T18:45:37.619485Z",
3333
"created": "2021-03-16T01:40:56.703Z",
34-
"updated": "2021-03-16T01:40:56.703Z"
34+
"updated": "2021-03-16T01:40:56.703Z",
35+
"renders": {
36+
"thumbnail": {
37+
"title": "Thumbnail",
38+
"assets": [
39+
"B4",
40+
"B3",
41+
"B2"
42+
],
43+
"rescale": [
44+
[
45+
0,
46+
150
47+
]
48+
],
49+
"colormap_name": "rainbow",
50+
"resampling": "bilinear",
51+
"bidx": [
52+
1
53+
],
54+
"width": 1024,
55+
"height": 1024,
56+
"bands": [
57+
"B4",
58+
"B3",
59+
"B2"
60+
]
61+
},
62+
"ndvi": {
63+
"title": "Normalized Difference Vegetation Index",
64+
"assets": [
65+
"ndvi"
66+
],
67+
"resampling": "average",
68+
"colormap_name": "ylgn"
69+
}
70+
}
3571
},
3672
"geometry": {
3773
"type": "Polygon",
@@ -283,42 +319,6 @@
283319
}
284320
}
285321
},
286-
"renders": {
287-
"thumbnail": {
288-
"title": "Thumbnail",
289-
"assets": [
290-
"B4",
291-
"B3",
292-
"B2"
293-
],
294-
"rescale": [
295-
[
296-
0,
297-
150
298-
]
299-
],
300-
"colormap_name": "rainbow",
301-
"resampling": "bilinear",
302-
"bidx": [
303-
1
304-
],
305-
"width": 1024,
306-
"height": 1024,
307-
"bands": [
308-
"B4",
309-
"B3",
310-
"B2"
311-
]
312-
},
313-
"ndvi": {
314-
"title": "Normalized Difference Vegetation Index",
315-
"assets": [
316-
"ndvi"
317-
],
318-
"resampling": "average",
319-
"colormap_name": "ylgn"
320-
}
321-
},
322322
"bbox": [
323323
-123.00234,
324324
37.82405,

examples/item-sentinel2.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,32 @@
6060
"sentinel:product_id": "S2B_MSIL2A_20210221T095029_N0214_R079_T33SVB_20210221T115149",
6161
"sentinel:data_coverage": 100,
6262
"eo:cloud_cover": 21.22,
63-
"sentinel:valid_cloud_cover": true
63+
"sentinel:valid_cloud_cover": true,
64+
"renders": {
65+
"sir": {
66+
"title": "Shortwave Infra-red",
67+
"assets": [
68+
"swir22",
69+
"nir2",
70+
"red"
71+
],
72+
"rescale": [
73+
[
74+
0,
75+
5000
76+
],
77+
[
78+
0,
79+
7000
80+
],
81+
[
82+
0,
83+
9000
84+
]
85+
],
86+
"resampling": "nearest"
87+
}
88+
}
6489
},
6590
"collection": "sentinel-s2-l2a-cogs",
6691
"assets": {
@@ -617,31 +642,6 @@
617642
]
618643
}
619644
},
620-
"renders": {
621-
"sir": {
622-
"title": "Shortwave Infra-red",
623-
"assets": [
624-
"swir22",
625-
"nir2",
626-
"red"
627-
],
628-
"rescale": [
629-
[
630-
0,
631-
5000
632-
],
633-
[
634-
0,
635-
7000
636-
],
637-
[
638-
0,
639-
9000
640-
]
641-
],
642-
"resampling": "nearest"
643-
}
644-
},
645645
"links": [
646646
{
647647
"rel": "collection",

json-schema/schema.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "STAC Rendering Extension for STAC Items and STAC Collections.",
66
"oneOf": [
77
{
8-
"$comment": "This is the schema for STAC Items. Remove this object if this extension only applies to Collections.",
8+
"$comment": "This is the schema for STAC Items.",
99
"allOf": [
1010
{
1111
"$ref": "#/definitions/stac_extensions"
@@ -14,18 +14,23 @@
1414
"type": "object",
1515
"required": [
1616
"type",
17-
"assets",
18-
"renders"
17+
"properties",
18+
"assets"
1919
],
2020
"properties": {
2121
"type": {
2222
"const": "Feature"
2323
},
24-
"renders": {
25-
"$comment": "This validates the fields in Item Assets, but does not require them.",
24+
"properties": {
2625
"type": "object",
27-
"additionalProperties": {
28-
"$ref": "#/definitions/fields"
26+
"required": ["renders"],
27+
"properties": {
28+
"renders": {
29+
"type": "object",
30+
"additionalProperties": {
31+
"$ref": "#/definitions/fields"
32+
}
33+
}
2934
}
3035
}
3136
}

0 commit comments

Comments
 (0)