Skip to content

Commit d63b143

Browse files
committed
Add and improve JSON Schema, fix examples, review
1 parent be82b9c commit d63b143

File tree

4 files changed

+167
-78
lines changed

4 files changed

+167
-78
lines changed

README.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
- **Scope:** Item, Collection
77
- **Extension [Maturity Classification](https://github.com/radiantearth/stac-spec/tree/master/extensions/README.md#extension-maturity):** Proposal
88
- **Owner**: @emmanuelmathot
9+
- **History**: [Prior to March 2nd 2021](https://github.com/radiantearth/stac-spec/commits/4a841605ad83a16f45fcb88ed90117d6c77a7f04/extensions/processing)
910

10-
Processing metadata is considered to be data that indicate from which processing chain a data originates and how the data itself has been produced. \
11+
Processing metadata is considered to be data that indicate from which processing chain a data originates and how the data itself has been produced.
1112
Overall, it helps to increase traceability and search among processing levels and multiple algorithm versions.
1213

13-
Often, data items are the result of one or more waterfall processing pipeline. Tracing information such as the processing facility, \
14+
Often, data items are the result of one or more waterfall processing pipeline. Tracing information such as the processing facility,
1415
the algorithm version or the processing date helps in the data version management.
1516

16-
This extension applies to STAC Items and STAC Collections. As these processing information are often closely bound to the Collection level \
17+
This extension applies to STAC Items and STAC Collections. As these processing information are often closely bound to the Collection level
1718
and therefore are shared across all items, it is recommended adding the fields to the corresponding STAC Collection.
1819

1920
- Examples:
@@ -22,10 +23,10 @@ and therefore are shared across all items, it is recommended adding the fields t
2223
- [JSON Schema](json-schema/schema.json)
2324
- [Changelog](./CHANGELOG.md)
2425

25-
## Item Properties and Collection Fields
26+
## Item Properties and Collection Provider Fields
2627

2728
- For Items, the fields are placed in the properties. Additionally, STAC allows all Item properties to be used in the Asset Object.
28-
- For Collections, the fields are placed in the [Provider Objects](https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#provider-object) \
29+
- For Collections, the fields are placed in the [Provider Objects](https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#provider-object)
2930
for the `providers` that have the role `producer` or `processor` assigned.
3031

3132
| Field Name | Type | Description |
@@ -47,34 +48,28 @@ In Items that declare this `processing` extension, it is recommended to add one
4748

4849
### Suggested Processing Levels
4950

50-
The `processing:level` is the name that is commonly used to refer to that processing level properties. \
51+
The `processing:level` is the name that is commonly used to refer to that processing level properties.
5152
The table below shows some processing level used by the industry for some data product.
5253

53-
Each level represents a step in the abstraction process by which data relevant to physical information (raw, level 0, level 1) \
54-
are turned into data relevant to geo physical information (level 2, level 3), and finally turned into data relevant to thematic information (level4)
54+
Each level represents a step in the abstraction process by which data relevant to physical information (raw, level 0, level 1)
55+
are turned into data relevant to geo physical information (level 2, level 3), and finally turned into data relevant to thematic information (level 4)
5556

5657
This list is not exhaustive and can be extended with the processing level specific to a data product.
5758

58-
| Level Name | Description | Typical data product |
59-
| ---------- | ----------- | -------------------- |
59+
| Level Name | Description | Typical data product |
60+
| ---------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
6061
| RAW | Data in their original packets, as received from the instrument. | [Sentinel-1 RAW](https://sentinel.esa.int/web/sentinel/technical-guides/sentinel-1-sar/products-algorithms/level-0-products/raw) |
61-
| L0 | Reconstructed unprocessed instrument data at full space time resolution with all available supplemental information to be used in subsequent processing (e.g., ephemeris, health and safety) appended. | [Landsat Level 0](https://www.usgs.gov/media/files/landsat-8-level-0-reformatted-data-format-control-book) |
62+
| L0 | Reconstructed unprocessed instrument data at full space time resolution with all available supplemental information to be used in subsequent processing (e.g., ephemeris, health and safety) appended. | [Landsat Level 0](https://www.usgs.gov/media/files/landsat-8-level-0-reformatted-data-format-control-book) |
6263
| L1 | Unpacked, reformatted level 0 data, with all supplemental information to be used in subsequent processing appended. Optional radiometric and geometric correction applied to produce parameters in physical units. Data generally presented as full time/space resolution. A wide variety of sub level products are possible (see below). | [Sentinel-1 Level 1](https://sentinel.esa.int/web/sentinel/user-guides/sentinel-1-sar/product-types-processing-levels/level-1) [Sentinel-2 L1A](https://sentinel.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types/level-1a) |
63-
| L2 | Retrieved environmental variables (e.g., ocean wave height, soil-moisture, ice concentration) at the same resolution and location as the level 1 source data. A wide variety of sub-level products are possible (see below). | [Sentinel-2 L2A](https://earth.esa.int/web/sentinel/technical-guides/sentinel-2-msi/level-2a-processing) |
64-
| L3 | Data or retrieved environmental variables which have been spatiallyand/or temporally re-sampled (i.e., derived from level 1 or 2 products). Such re-sampling may include averaging and compositing. A wide variety of sub-level products are possible (see below). | [ENVISAT Level-3](http://envisat.esa.int/level3/), [Sentinel-2 L3](https://s2gm.sentinel-hub.com/) |
65-
| L4 | Model output or results from analyses of lower level data (i.e.,variables that are not directly measured by the instruments, but are derived from these measurements) | |
66-
67-
## Extensions
68-
69-
The [extensions page](https://stac-extensions.github.io/) gives an overview about related extensions. Of particular relevance to processing levels:
70-
71-
- the [Sat Extension Specification](https://github.com/stac-extensions/sat/blob/main/README.md) to describe data collected from a satellite.
64+
| L2 | Retrieved environmental variables (e.g., ocean wave height, soil-moisture, ice concentration) at the same resolution and location as the level 1 source data. A wide variety of sub-level products are possible (see below). | [Sentinel-2 L2A](https://earth.esa.int/web/sentinel/technical-guides/sentinel-2-msi/level-2a-processing) |
65+
| L3 | Data or retrieved environmental variables which have been spatiallyand/or temporally re-sampled (i.e., derived from level 1 or 2 products). Such re-sampling may include averaging and compositing. A wide variety of sub-level products are possible (see below). | [ENVISAT Level-3](http://envisat.esa.int/level3/), [Sentinel-2 L3](https://s2gm.sentinel-hub.com/) |
66+
| L4 | Model output or results from analyses of lower level data (i.e.,variables that are not directly measured by the instruments, but are derived from these measurements) | |
7267

7368
## Relation types
7469

7570
The following types should be used as applicable `rel` types in the
7671
[Link Object](https://github.com/radiantearth/stac-spec/tree/master/item-spec/item-spec.md#link-object).
7772

78-
| Type | Description |
79-
| ------------------- | ----------- |
80-
| derived_from | URL to a STAC Item that was used as input data in the creation of this Item. |
73+
| Type | Description |
74+
| ------------ | ------------------------------------------------------------ |
75+
| derived_from | URL to a STAC Item that was used as input data in the creation of this Item. |

examples/collection.json

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
{
2-
"stac_version": "1.0.0-beta.2",
3-
"type": "Collection",
2+
"stac_version": "1.0.0-rc.1",
43
"stac_extensions": [
54
"https://stac-extensions.github.io/processing/v1.0.0/schema.json"
65
],
6+
"type": "Collection",
77
"id": "Sentinel2-L2A",
88
"title": "Sentinel-2 MSI: MultiSpectral Instrument, Level-2A",
99
"description": "Sentinel-2 is a wide-swath, high-resolution, multi-spectral imaging mission.",
1010
"license": "proprietary",
11-
"keywords": [
12-
"copernicus",
13-
"esa",
14-
"eu",
15-
"msi",
16-
"radiance",
17-
"sentinel"
18-
],
1911
"providers": [
2012
{
2113
"name": "European Union/ESA/Copernicus",
@@ -27,7 +19,7 @@
2719
"processing:lineage": "Generation of Level-1C User Product",
2820
"processing:level": "L1C",
2921
"processing:facility": "Copernicus S2 Processing and Archiving Facility",
30-
"processing:software_version": {
22+
"processing:software": {
3123
"IPF-S2L1C": "02.06"
3224
}
3325
},
@@ -38,9 +30,15 @@
3830
],
3931
"processing:lineage": "Generation of Level-2A User Product",
4032
"processing:level": "L2A",
41-
"processing:software_version": {
33+
"processing:software": {
4234
"Sentinel-2 Toolbox": "8.0.0"
4335
}
36+
},
37+
{
38+
"name": "Storage Provider, Inc.",
39+
"roles": [
40+
"host"
41+
]
4442
}
4543
],
4644
"extent": {

examples/item.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2+
"stac_version": "1.0.0-rc.1",
23
"stac_extensions": [
34
"https://stac-extensions.github.io/sat/v1.0.0/schema.json",
45
"https://stac-extensions.github.io/sar/v1.0.0/schema.json",
56
"https://stac-extensions.github.io/processing/v1.0.0/schema.json"
67
],
7-
"stac_version": "1.0.0-beta.2",
88
"id": "S1A_IW_GRDH_1SDV_20160822T182823_20160822T182848_012717_013FFE_90AF",
99
"properties": {
1010
"datetime": "2016-08-22T18:28:23.368922Z",
@@ -44,7 +44,7 @@
4444
],
4545
"title": "SAFE Manifest",
4646
"href": "data/S1A_IW_GRDH_1SDV_20160822T182823_20160822T182848_012717_013FFE_90AF.SAFE/manifest.safe",
47-
"created": "2016-08-23T00:30:33.319454"
47+
"created": "2016-08-23T00:30:33Z"
4848
},
4949
"quick-look": {
5050
"type": "image/png",

json-schema/schema.json

Lines changed: 137 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "https://stac-extensions.github.io/template/v1.0.0/schema.json#",
4-
"title": "Template Extension",
5-
"description": "STAC Template Extension for STAC Items and STAC Collections.",
6-
"oneOf": [
3+
"$id": "https://stac-extensions.github.io/processing/v1.0.0/schema.json#",
4+
"title": "Processing Extension",
5+
"description": "STAC Processing Extension for STAC Items and STAC Collections.",
6+
"anyOf": [
77
{
88
"$comment": "This is the schema for STAC Items.",
99
"allOf": [
@@ -21,10 +21,7 @@
2121
"properties": {
2222
"allOf": [
2323
{
24-
"$comment": "Require fields here for item properties.",
25-
"required": [
26-
"template:new_field"
27-
]
24+
"$ref": "#/definitions/requirements"
2825
},
2926
{
3027
"$ref": "#/definitions/fields"
@@ -45,12 +42,84 @@
4542
]
4643
},
4744
{
48-
"$comment": "This is the schema for STAC Collections.",
45+
"$comment": "This is the schema for STAC Collections (Providers).",
4946
"allOf": [
5047
{
5148
"type": "object",
5249
"required": [
53-
"type"
50+
"type",
51+
"providers"
52+
],
53+
"properties": {
54+
"type": {
55+
"const": "Collection"
56+
},
57+
"providers": {
58+
"type": "array",
59+
"minItems": 1,
60+
"items": {
61+
"type": "object",
62+
"oneOf": [
63+
{
64+
"allOf": [
65+
{
66+
"required": [
67+
"roles"
68+
],
69+
"properties": {
70+
"roles": {
71+
"type": "array",
72+
"contains": {
73+
"enum": [
74+
"producer",
75+
"processor"
76+
]
77+
}
78+
}
79+
}
80+
},
81+
{
82+
"$ref": "#/definitions/requirements"
83+
},
84+
{
85+
"$ref": "#/definitions/fields"
86+
}
87+
]
88+
},
89+
{
90+
"patternProperties": {
91+
"^(?!processing:)": {}
92+
},
93+
"additionalProperties": false
94+
}
95+
]
96+
}
97+
}
98+
}
99+
},
100+
{
101+
"$ref": "#/definitions/stac_extensions"
102+
}
103+
]
104+
},
105+
{
106+
"$comment": "This is the schema for STAC Collections (Assets).",
107+
"allOf": [
108+
{
109+
"type": "object",
110+
"anyOf": [
111+
{
112+
"required": [
113+
"type",
114+
"assets"
115+
]
116+
},
117+
{
118+
"required": [
119+
"type",
120+
"item_assets"
121+
]
122+
}
54123
],
55124
"properties": {
56125
"type": {
@@ -72,9 +141,6 @@
72141
},
73142
{
74143
"$ref": "#/definitions/stac_extensions"
75-
},
76-
{
77-
"$ref": "#/definitions/fields"
78144
}
79145
]
80146
}
@@ -89,48 +155,78 @@
89155
"stac_extensions": {
90156
"type": "array",
91157
"contains": {
92-
"const": "https://stac-extensions.github.io/template/v1.0.0/schema.json"
158+
"const": "https://stac-extensions.github.io/processing/v1.0.0/schema.json"
93159
}
94160
}
95161
}
96162
},
163+
"requirements": {
164+
"anyOf": [
165+
{
166+
"required": [
167+
"processing:lineage"
168+
]
169+
},
170+
{
171+
"required": [
172+
"processing:level"
173+
]
174+
},
175+
{
176+
"required": [
177+
"processing:facility"
178+
]
179+
},
180+
{
181+
"required": [
182+
"processing:software"
183+
]
184+
}
185+
]
186+
},
97187
"fields": {
98-
"$comment": "Add your new fields here. Don't require them here, do that above in the item schema.",
99188
"type": "object",
100189
"properties": {
101-
"template:new_field": {
102-
"type": "string"
190+
"processing:lineage": {
191+
"title": "Processing Lineage Information",
192+
"type": "string",
193+
"example": "Post Processing GRD"
103194
},
104-
"template:xyz": {
195+
"processing:level": {
196+
"title": "Processing Level",
197+
"type": "string",
198+
"examples": [
199+
"RAW",
200+
"L1",
201+
"L1A",
202+
"L1B",
203+
"L1C",
204+
"L2",
205+
"L2A",
206+
"L3",
207+
"L4"
208+
]
209+
},
210+
"processing:facility": {
211+
"title": "Processing Facility",
212+
"type": "string",
213+
"example": "Copernicus S1 Core Ground Segment - DPA"
214+
},
215+
"processing:software": {
216+
"title": "Processing Software Name / version",
105217
"type": "object",
106-
"required": [
107-
"x",
108-
"y",
109-
"z"
110-
],
111-
"properties": {
112-
"x": {
113-
"type": "number"
114-
},
115-
"y": {
116-
"type": "number"
117-
},
118-
"z": {
119-
"type": "number"
218+
"patternProperties": {
219+
".{1,}": {
220+
"type": "string"
120221
}
121-
}
122-
},
123-
"template:another_one": {
124-
"type": "array",
125-
"items": {
126-
"type": "number"
222+
},
223+
"example": {
224+
"Sentinel-1 IPF": "002.71"
127225
}
128226
}
129227
},
130228
"patternProperties": {
131-
"^(?!template:)": {
132-
"$comment": "Above, change `template` to the prefix of this extension",
133-
}
229+
"^(?!processing:)": {}
134230
},
135231
"additionalProperties": false
136232
}

0 commit comments

Comments
 (0)