From ee8022b24d40f55a9b6d9b56d2729def8f676c3c Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 22 Apr 2021 17:37:08 +0200 Subject: [PATCH] Example (WIP), more details --- catalog-spec/json-schema/catalog-core.json | 1 + collection-spec/collection-spec.md | 3 +- .../collection-with-schemas.json | 281 ++++++++++++++++++ 3 files changed, 284 insertions(+), 1 deletion(-) create mode 100644 examples/collection-only/collection-with-schemas.json diff --git a/catalog-spec/json-schema/catalog-core.json b/catalog-spec/json-schema/catalog-core.json index dec52cf9..214df4bb 100644 --- a/catalog-spec/json-schema/catalog-core.json +++ b/catalog-spec/json-schema/catalog-core.json @@ -103,6 +103,7 @@ { "title": "JSON Schema", "type": "object", + "minProperties": 1, "allOf": [ { "$ref": "http://json-schema.org/draft-07/schema" diff --git a/collection-spec/collection-spec.md b/collection-spec/collection-spec.md index 349bda0d..fa14e58f 100644 --- a/collection-spec/collection-spec.md +++ b/collection-spec/collection-spec.md @@ -300,9 +300,10 @@ Implementors are free to add other derived statistical values to the object, for For a full understanding of the summarized field, a JSON Schema can be added for each summarized field. This allows very fine-grained information for each field and each value as JSON Schema is also extensible. +Each schema must be valid against all corresponding values available for the property in the sub-Items. It is recommended to use [JSON Schema draft-07](https://json-schema.org/specification-links.html#draft-7) -to align with the JSON Schemas provided by STAC. +to align with the JSON Schemas provided by STAC. Empty schemas are not allowed. ## Media Type for STAC Collections diff --git a/examples/collection-only/collection-with-schemas.json b/examples/collection-only/collection-with-schemas.json new file mode 100644 index 00000000..4aa2c21e --- /dev/null +++ b/examples/collection-only/collection-with-schemas.json @@ -0,0 +1,281 @@ +{ + "stac_version": "1.0.0-rc.2", + "stac_extensions": [ + "https://stac-extensions.github.io/eo/v1.0.0/schema.json", + "https://stac-extensions.github.io/sat/v1.0.0/schema.json", + "https://stac-extensions.github.io/view/v1.0.0/schema.json" + ], + "id": "S2", + "type": "Collection", + "title": "Level 1C Sentinel-2 images", + "description": "The SENTINEL-2 mission is a land monitoring constellation of two satellites each equipped with a MSI (Multispectral Imager) instrument covering 13 spectral bands providing high resolution optical imagery (i.e., 10m, 20m, 60 m) every 10 days with one satellite and 5 days with two satellites", + "license": "proprietary", + "extent": { + "spatial": { + "bbox": [ + [ + -180, + -82.852377834669, + 180, + 82.819463367711 + ] + ] + }, + "temporal": { + "interval": [ + [ + "2017-04-12T02:57:21.459000Z", + "2021-04-22T11:30:12.767000Z" + ] + ] + } + }, + "links": [ + { + "rel": "self", + "type": "application/json", + "href": "https://tamn.snapplanet.io/collections/S2" + }, + { + "rel": "root", + "type": "application/json", + "href": "https://tamn.snapplanet.io" + }, + { + "rel": "license", + "href": "https://scihub.copernicus.eu/twiki/pub/SciHubWebPortal/TermsConditions/Sentinel_Data_Terms_and_Conditions.pdf", + "title": "Legal notice on the use of Copernicus Sentinel Data and Service Information" + } + ], + "providers": [ + { + "name": "European Union/ESA/Copernicus", + "roles": [ + "producer", + "licensor" + ], + "url": "https://sentinel.esa.int/web/sentinel/user-guides/sentinel-2-msi" + }, + { + "name": "AWS", + "roles": [ + "host" + ], + "url": "https://registry.opendata.aws/sentinel-2/" + }, + { + "name": "jeobrowser", + "roles": [ + "processor" + ], + "url": "https://github.com/jjrom/resto" + } + ], + "summaries": { + "datetime": { + "minimum": "2017-04-12T02:57:21.459000Z", + "maximum": "2021-04-22T11:30:12.767000Z" + }, + "collection": { + "type": "string", + "const": "sentinel-2", + "title": "Sentinel 2", + "count": 6613407 + }, + "instruments": { + "type": "string", + "const": "msi", + "title": "MSI", + "count": 6613431 + }, + "landcover": { + "type": "string", + "oneOf": [ + { + "const": "landcover:cultivated", + "title": "Cultivated", + "count": 490750 + }, + { + "const": "landcover:desert", + "title": "Desert", + "count": 543120 + }, + { + "const": "landcover:flooded", + "title": "Flooded", + "count": 5187 + }, + { + "const": "landcover:forest", + "title": "Forest", + "count": 767807 + }, + { + "const": "landcover:herbaceous", + "title": "Herbaceous", + "count": 674281 + }, + { + "const": "landcover:ice", + "title": "Ice", + "count": 231285 + }, + { + "const": "landcover:urban", + "title": "Urban", + "count": 1219 + }, + { + "const": "landcover:water", + "title": "Water", + "count": 2303314 + } + ] + }, + "location": { + "type": "string", + "oneOf": [ + { + "const": "tropical", + "title": "Tropical", + "count": 1807474 + }, + { + "const": "southern", + "title": "Southern", + "count": 1671685 + }, + { + "const": "northern", + "title": "Northern", + "count": 4876669 + }, + { + "const": "equatorial", + "title": "Equatorial", + "count": 27302 + }, + { + "const": "coastal", + "title": "Coastal", + "count": 1495516 + } + ] + }, + "platform": { + "type": "string", + "oneOf": [ + { + "const": "sentinel-2b", + "title": "Sentinel 2B", + "count": 3495597 + }, + { + "const": "sentinel-2a", + "title": "Sentinel 2A", + "count": 3117831 + } + ] + }, + "season": { + "type": "integer", + "oneOf": [ + { + "const": 0, + "title": "Winter", + "count": 1621108 + }, + { + "const": 2, + "title": "Summer", + "count": 2279472 + }, + { + "const": 1, + "title": "Spring", + "count": 1577067 + }, + { + "const": 3, + "title": "Autumn", + "count": 1098015 + } + ] + }, + "eo:bands": [ + { + "title": "B1", + "common_name": "coastal", + "center_wavelength": 4.439, + "gsd": 60 + }, + { + "title": "B2", + "common_name": "blue", + "center_wavelength": 4.966, + "gsd": 10 + }, + { + "title": "B3", + "common_name": "green", + "center_wavelength": 5.6, + "gsd": 10 + }, + { + "title": "B4", + "common_name": "red", + "center_wavelength": 6.645, + "gsd": 10 + }, + { + "title": "B5", + "center_wavelength": 7.039, + "gsd": 20 + }, + { + "title": "B6", + "center_wavelength": 7.402, + "gsd": 20 + }, + { + "title": "B7", + "center_wavelength": 7.825, + "gsd": 20 + }, + { + "title": "B8", + "common_name": "nir", + "center_wavelength": 8.351, + "gsd": 10 + }, + { + "title": "B8A", + "center_wavelength": 8.648, + "gsd": 20 + }, + { + "title": "B9", + "center_wavelength": 9.45, + "gsd": 60 + }, + { + "title": "B10", + "center_wavelength": 1.3735, + "gsd": 60 + }, + { + "title": "B11", + "common_name": "swir16", + "center_wavelength": 1.6137, + "gsd": 20 + }, + { + "title": "B12", + "common_name": "swir22", + "center_wavelength": 2.2024, + "gsd": 20 + } + ] + } +} \ No newline at end of file