diff --git a/CHANGELOG.md b/CHANGELOG.md index dd0fd2f..4b14532 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,17 @@ # Changelog + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [2.0.0] ### Added +- Initial creation of community extension from +- Added `landsat:product_generated` field + ### Changed ### Deprecated @@ -16,4 +20,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -[Unreleased]: + +[2.0.0]: diff --git a/README.md b/README.md index bf65d0e..4447252 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,16 @@ -# Template Extension Specification +# Landsat Extension Specification -- **Title:** Template -- **Identifier:** -- **Field Name Prefix:** template -- **Scope:** Item, Collection -- **Extension [Maturity Classification](https://github.com/radiantearth/stac-spec/tree/master/extensions/README.md#extension-maturity):** Proposal -- **Owner**: @your-gh-handles @person2 +- **Title:** Landsat +- **Identifier:** +- **Field Name Prefix:** landsat +- **Scope:** Item +- **Extension [Maturity Classification](https://github.com/radiantearth/stac-spec/tree/master/extensions/README.md#extension-maturity):** Stable +- **Owner**: @philvarner -This document explains the Template Extension to the [SpatioTemporal Asset Catalog](https://github.com/radiantearth/stac-spec) (STAC) specification. -This is the place to add a short introduction. +This document explains the Landsat Extension to the [SpatioTemporal Asset Catalog](https://github.com/radiantearth/stac-spec) (STAC) specification. - Examples: - [Item example](examples/item.json): Shows the basic usage of the extension in a STAC Item - - [Collection example](examples/collection.json): Shows the basic usage of the extension in a STAC Collection - [JSON Schema](json-schema/schema.json) - [Changelog](./CHANGELOG.md) @@ -21,41 +19,34 @@ This is the place to add a short introduction. The fields in the table below can be used in these parts of STAC documents: - [ ] Catalogs -- [x] Collections +- [ ] Collections - [x] Item Properties (incl. Summaries in Collections) -- [x] Assets (for both Collections and Items, incl. Item Asset Definitions in Collections) +- [ ] Assets (for both Collections and Items, incl. Item Asset Definitions in Collections) - [ ] Links -| Field Name | Type | Description | -| -------------------- | ------------------------- | -------------------------------------------- | -| template:new_field | string | **REQUIRED**. Describe the required field... | -| template:xyz | [XYZ Object](#xyz-object) | Describe the field... | -| template:another_one | \[number] | Describe the field... | +| Field Name | Type | Description | +| --------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| landsat:scene_id | string | Landsat Scene Identifier | +| landsat:collection_category | string | Collection Category | +| landsat:collection_number | string | Collection Number | +| landsat:wrs_type | string | WRS Type | +| landsat:wrs_path | string | WRS Path | +| landsat:wrs_row | string | WRS Row | +| landsat:cloud_cover_land | number | Land Cloud Cover | +| landsat:correction | string | Product Correction Level | +| landsat:product_generated | string | The dateime that the product (data) was generated, formatted according to [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). | ### Additional Field Information -#### template:new_field +#### landsat:product_generated -This is a much more detailed description of the field `template:new_field`... - -### XYZ Object - -This is the introduction for the purpose and the content of the XYZ Object... - -| Field Name | Type | Description | -| ---------- | ------ | -------------------------------------------- | -| x | number | **REQUIRED**. Describe the required field... | -| y | number | **REQUIRED**. Describe the required field... | -| z | number | **REQUIRED**. Describe the required field... | +The datetime associated with the generation of the product. This will typically be +the metadata field at the path `LEVEL1_PROCESSING_RECORD/DATE_PRODUCT_GENERATED` or +`LEVEL2_PROCESSING_RECORD/DATE_PRODUCT_GENERATED`. ## Relation types -The following types should be used as applicable `rel` types in the -[Link Object](https://github.com/radiantearth/stac-spec/tree/master/item-spec/item-spec.md#link-object). - -| Type | Description | -| -------------- | ------------------------------------- | -| fancy-rel-type | This link points to a fancy resource. | +None. ## Contributing @@ -67,16 +58,18 @@ for running tests are copied here for convenience. ### Running tests -The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid. +The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid. To run tests locally, you'll need `npm`, which is a standard part of any [node.js installation](https://nodejs.org/en/download/). -First you'll need to install everything with npm once. Just navigate to the root of this repository and on +First you'll need to install everything with npm once. Just navigate to the root of this repository and on your command line run: + ```bash npm install ``` Then to check markdown formatting and test the examples against the JSON schema, you can run: + ```bash npm test ``` @@ -84,6 +77,7 @@ npm test This will spit out the same texts that you see online, and you can then go and fix your markdown or examples. If the tests reveal formatting problems with the examples, you can fix them with: + ```bash npm run format-examples ``` diff --git a/examples/collection.json b/examples/collection.json deleted file mode 100644 index 2472ecc..0000000 --- a/examples/collection.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "stac_version": "1.0.0", - "stac_extensions": [ - "https://stac-extensions.github.io/item-assets/v1.0.0/schema.json", - "https://stac-extensions.github.io/template/v1.0.0/schema.json" - ], - "type": "Collection", - "id": "collection", - "title": "A title", - "description": "A description", - "license": "Apache-2.0", - "extent": { - "spatial": { - "bbox": [ - [ - 172.9, - 1.3, - 173, - 1.4 - ] - ] - }, - "temporal": { - "interval": [ - [ - "2015-06-23T00:00:00Z", - null - ] - ] - } - }, - "template:new_field": "test", - "template:xyz": { - "x": 1, - "y": 2, - "z": 3 - }, - "template:another_one": [ - 1, - 2, - 3 - ], - "assets": { - "example": { - "href": "https://example.com/examples/file.xyz", - "template:new_field": "test" - } - }, - "item_assets": { - "data": { - "roles": [ - "data" - ], - "template:new_field": "test" - } - }, - "summaries": { - "datetime": { - "minimum": "2015-06-23T00:00:00Z", - "maximum": "2019-07-10T13:44:56Z" - } - }, - "links": [ - { - "href": "https://example.com/examples/collection.json", - "rel": "self" - }, - { - "href": "https://example.com/examples/item.json", - "rel": "item" - } - ] -} diff --git a/examples/item.json b/examples/item.json index cf19370..22aa022 100644 --- a/examples/item.json +++ b/examples/item.json @@ -1,67 +1,1030 @@ { - "stac_version": "1.0.0", - "stac_extensions": [ - "https://stac-extensions.github.io/template/v1.0.0/schema.json" - ], "type": "Feature", - "id": "item", - "bbox": [ - 172.9, - 1.3, - 173, - 1.4 - ], + "stac_version": "1.0.0", + "id": "LC09_L2SR_145060_20230307_02_T1", + "properties": { + "platform": "landsat-9", + "instruments": [ + "oli", + "tirs" + ], + "created": "2023-03-23T13:16:46.773Z", + "gsd": 30, + "description": "Landsat Collection 2 Level-2", + "eo:cloud_cover": 3.57, + "view:off_nadir": 0, + "view:sun_elevation": 59.91233913, + "view:sun_azimuth": 100.77997099, + "proj:epsg": 32643, + "proj:shape": [ + 7731, + 7591 + ], + "proj:transform": [ + 30, + 0, + 155085, + 0, + -30, + 115515 + ], + "landsat:cloud_cover_land": 5.7, + "landsat:wrs_type": "2", + "landsat:wrs_path": "145", + "landsat:wrs_row": "060", + "landsat:collection_category": "T1", + "landsat:collection_number": "02", + "landsat:correction": "L2SR", + "landsat:scene_id": "LC91450602023066LGN00", + "landsat:product_generated": "2023-03-07T06:21:53Z", + "sci:doi": "10.5066/P9OGBGM6", + "datetime": "2023-03-07T05:20:49.435064Z", + "earthsearch:payload_id": "usgs-landsat-c2l2/workflow-landsat-to-stac/LC09_L2SR_145060_20230307_20230309_02_T1_SR", + "processing:software": { + "landsat-to-stac": "0.1.0" + }, + "updated": "2023-03-23T13:16:46.773Z" + }, "geometry": { "type": "Polygon", "coordinates": [ [ [ - 172.9, - 1.3 + 72.2915625219118, + 1.0393152870659377 ], [ - 173, - 1.3 + 71.92343749916984, + -0.6955869020790707 ], [ - 173, - 1.4 + 73.56315662263279, + -1.0477531877332225 ], [ - 172.9, - 1.4 + 73.93150584934482, + 0.6907768410669702 ], [ - 172.9, - 1.3 + 72.2915625219118, + 1.0393152870659377 ] ] ] }, - "properties": { - "datetime": "2020-12-11T22:38:32Z", - "template:new_field": "test", - "template:xyz": { - "x": 1, - "y": 2, - "z": 3 - }, - "template:another_one": [ - 1, - 2, - 3 - ] - }, "links": [ { - "href": "https://example.com/examples/item.json", - "rel": "self" + "rel": "self", + "type": "application/geo+json", + "href": "https://earth-search.dev.aws.element84.com/dev/collections/landsat-c2-l2/items/LC09_L2SR_145060_20230307_02_T1" + }, + { + "rel": "canonical", + "href": "s3://earthsearch-data/landsat-c2-l2/145/060/2023/3/LC09_L2SR_145060_20230307_02_T1/LC09_L2SR_145060_20230307_02_T1.json", + "type": "application/json" + }, + { + "rel": "cite-as", + "href": "https://doi.org/10.5066/P9OGBGM6", + "title": "Landsat 8-9 OLI/TIRS Collection 2 Level-2" + }, + { + "rel": "via", + "href": "https://landsatlook.usgs.gov/stac-server/collections/landsat-c2l2-sr/items/LC09_L2SR_145060_20230307_20230309_02_T1_SR", + "type": "application/json", + "title": "USGS STAC Item" + }, + { + "rel": "parent", + "type": "application/json", + "href": "https://earth-search.dev.aws.element84.com/dev/collections/landsat-c2-l2" + }, + { + "rel": "collection", + "type": "application/json", + "href": "https://earth-search.dev.aws.element84.com/dev/collections/landsat-c2-l2" + }, + { + "rel": "root", + "type": "application/json", + "href": "https://earth-search.dev.aws.element84.com/dev" + }, + { + "rel": "thumbnail", + "href": "https://earth-search.dev.aws.element84.com/dev/collections/landsat-c2-l2/items/LC09_L2SR_145060_20230307_02_T1/thumbnail" + }, + { + "rel": "parent", + "type": "application/json", + "href": "https://earth-search.dev.aws.element84.com/dev/collections/landsat-c2-l2" + }, + { + "rel": "collection", + "type": "application/json", + "href": "https://earth-search.dev.aws.element84.com/dev/collections/landsat-c2-l2" + }, + { + "rel": "root", + "type": "application/json", + "href": "https://earth-search.dev.aws.element84.com/dev" + }, + { + "rel": "thumbnail", + "href": "https://earth-search.dev.aws.element84.com/dev/collections/landsat-c2-l2/items/LC09_L2SR_145060_20230307_02_T1/thumbnail" } ], "assets": { - "data": { - "href": "https://example.com/examples/file.xyz", - "template:new_field": "test" + "thumbnail": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_thumb_small.jpeg", + "type": "image/jpeg", + "title": "Thumbnail image", + "roles": [ + "thumbnail" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "reduced_resolution_browse": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_thumb_large.jpeg", + "type": "image/jpeg", + "title": "Reduced resolution browse image", + "roles": [ + "overview" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "mtl.json": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_MTL.json", + "type": "application/json", + "title": "Product Metadata File (json)", + "description": "Collection 2 Level-2 Product Metadata File (json)", + "roles": [ + "metadata" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "mtl.txt": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_MTL.txt", + "type": "text/plain", + "title": "Product Metadata File (txt)", + "description": "Collection 2 Level-2 Product Metadata File (txt)", + "roles": [ + "metadata" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "mtl.xml": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_MTL.xml", + "type": "application/xml", + "title": "Product Metadata File (xml)", + "description": "Collection 2 Level-2 Product Metadata File (xml)", + "roles": [ + "metadata" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "ang": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_ANG.txt", + "type": "text/plain", + "title": "Angle Coefficients File", + "description": "Collection 2 Level-1 Angle Coefficients File", + "roles": [ + "metadata" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "qa_pixel": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_QA_PIXEL.TIF", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "Pixel Quality Assessment Band", + "description": "Collection 2 Level-1 Pixel Quality Assessment Band (QA_PIXEL)", + "classification:bitfields": [ + { + "name": "fill", + "description": "Image or fill data", + "offset": 0, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_fill", + "description": "Image data" + }, + { + "value": 1, + "name": "fill", + "description": "Fill data" + } + ] + }, + { + "name": "dilated_cloud", + "description": "Dilated cloud", + "offset": 1, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_dilated", + "description": "Cloud is not dilated or no cloud" + }, + { + "value": 1, + "name": "dilated", + "description": "Cloud dilation" + } + ] + }, + { + "name": "cirrus", + "description": "Cirrus mask", + "offset": 2, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_cirrus", + "description": "Cirrus confidence is not high" + }, + { + "value": 1, + "name": "cirrus", + "description": "High confidence cirrus" + } + ] + }, + { + "name": "cloud", + "description": "Cloud mask", + "offset": 3, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_cloud", + "description": "Cloud confidence is not high" + }, + { + "value": 1, + "name": "cloud", + "description": "High confidence cloud" + } + ] + }, + { + "name": "cloud_shadow", + "description": "Cloud shadow mask", + "offset": 4, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_shadow", + "description": "Cloud shadow confidence is not high" + }, + { + "value": 1, + "name": "shadow", + "description": "High confidence cloud shadow" + } + ] + }, + { + "name": "snow", + "description": "Snow/Ice mask", + "offset": 5, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_snow", + "description": "Snow/Ice confidence is not high" + }, + { + "value": 1, + "name": "snow", + "description": "High confidence snow cover" + } + ] + }, + { + "name": "clear", + "description": "Clear mask", + "offset": 6, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_clear", + "description": "Cloud or dilated cloud bits are set" + }, + { + "value": 1, + "name": "clear", + "description": "Cloud and dilated cloud bits are not set" + } + ] + }, + { + "name": "water", + "description": "Water mask", + "offset": 7, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_water", + "description": "Land or cloud" + }, + { + "value": 1, + "name": "water", + "description": "Water" + } + ] + }, + { + "name": "cloud_confidence", + "description": "Cloud confidence levels", + "offset": 8, + "length": 2, + "classes": [ + { + "value": 0, + "name": "not_set", + "description": "No confidence level set" + }, + { + "value": 1, + "name": "low", + "description": "Low confidence cloud" + }, + { + "value": 2, + "name": "medium", + "description": "Medium confidence cloud" + }, + { + "value": 3, + "name": "high", + "description": "High confidence cloud" + } + ] + }, + { + "name": "cloud_shadow_confidence", + "description": "Cloud shadow confidence levels", + "offset": 10, + "length": 2, + "classes": [ + { + "value": 0, + "name": "not_set", + "description": "No confidence level set" + }, + { + "value": 1, + "name": "low", + "description": "Low confidence cloud shadow" + }, + { + "value": 2, + "name": "reserved", + "description": "Reserved - value not used" + }, + { + "value": 3, + "name": "high", + "description": "High confidence cloud shadow" + } + ] + }, + { + "name": "snow_confidence", + "description": "Snow/Ice confidence levels", + "offset": 12, + "length": 2, + "classes": [ + { + "value": 0, + "name": "not_set", + "description": "No confidence level set" + }, + { + "value": 1, + "name": "low", + "description": "Low confidence snow/ice" + }, + { + "value": 2, + "name": "reserved", + "description": "Reserved - value not used" + }, + { + "value": 3, + "name": "high", + "description": "High confidence snow/ice" + } + ] + }, + { + "name": "cirrus_confidence", + "description": "Cirrus confidence levels", + "offset": 14, + "length": 2, + "classes": [ + { + "value": 0, + "name": "not_set", + "description": "No confidence level set" + }, + { + "value": 1, + "name": "low", + "description": "Low confidence cirrus" + }, + { + "value": 2, + "name": "reserved", + "description": "Reserved - value not used" + }, + { + "value": 3, + "name": "high", + "description": "High confidence cirrus" + } + ] + } + ], + "raster:bands": [ + { + "nodata": 1, + "data_type": "uint16", + "spatial_resolution": 30, + "unit": "bit index" + } + ], + "roles": [ + "cloud", + "cloud-shadow", + "snow-ice", + "water-mask" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "qa_radsat": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_QA_RADSAT.TIF", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "Radiometric Saturation and Terrain Occlusion Quality Assessment Band", + "description": "Collection 2 Level-1 Radiometric Saturation and Terrain Occlusion Quality Assessment Band (QA_RADSAT)", + "classification:bitfields": [ + { + "name": "band1", + "description": "Band 1 radiometric saturation", + "offset": 0, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_saturated", + "description": "Band 1 not saturated" + }, + { + "value": 1, + "name": "saturated", + "description": "Band 1 saturated" + } + ] + }, + { + "name": "band2", + "description": "Band 2 radiometric saturation", + "offset": 1, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_saturated", + "description": "Band 2 not saturated" + }, + { + "value": 1, + "name": "saturated", + "description": "Band 2 saturated" + } + ] + }, + { + "name": "band3", + "description": "Band 3 radiometric saturation", + "offset": 2, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_saturated", + "description": "Band 3 not saturated" + }, + { + "value": 1, + "name": "saturated", + "description": "Band 3 saturated" + } + ] + }, + { + "name": "band4", + "description": "Band 4 radiometric saturation", + "offset": 3, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_saturated", + "description": "Band 4 not saturated" + }, + { + "value": 1, + "name": "saturated", + "description": "Band 4 saturated" + } + ] + }, + { + "name": "band5", + "description": "Band 5 radiometric saturation", + "offset": 4, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_saturated", + "description": "Band 5 not saturated" + }, + { + "value": 1, + "name": "saturated", + "description": "Band 5 saturated" + } + ] + }, + { + "name": "band6", + "description": "Band 6 radiometric saturation", + "offset": 5, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_saturated", + "description": "Band 6 not saturated" + }, + { + "value": 1, + "name": "saturated", + "description": "Band 6 saturated" + } + ] + }, + { + "name": "band7", + "description": "Band 7 radiometric saturation", + "offset": 6, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_saturated", + "description": "Band 7 not saturated" + }, + { + "value": 1, + "name": "saturated", + "description": "Band 7 saturated" + } + ] + }, + { + "name": "band9", + "description": "Band 9 radiometric saturation", + "offset": 8, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_saturated", + "description": "Band 9 not saturated" + }, + { + "value": 1, + "name": "saturated", + "description": "Band 9 saturated" + } + ] + }, + { + "name": "occlusion", + "description": "Terrain not visible from sensor due to intervening terrain", + "offset": 11, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_occluded", + "description": "Terrain is not occluded" + }, + { + "value": 1, + "name": "occluded", + "description": "Terrain is occluded" + } + ] + } + ], + "raster:bands": [ + { + "data_type": "uint16", + "spatial_resolution": 30, + "unit": "bit index" + } + ], + "roles": [ + "saturation" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "coastal": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_SR_B1.TIF", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "Coastal/Aerosol Band", + "description": "Collection 2 Level-2 Coastal/Aerosol Band (SR_B1) Surface Reflectance", + "eo:bands": [ + { + "name": "OLI_B1", + "common_name": "coastal", + "description": "Coastal/Aerosol", + "center_wavelength": 0.44, + "full_width_half_max": 0.02 + } + ], + "raster:bands": [ + { + "nodata": 0, + "data_type": "uint16", + "spatial_resolution": 30, + "scale": 0.0000275, + "offset": -0.2 + } + ], + "roles": [ + "data", + "reflectance" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "blue": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_SR_B2.TIF", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "Blue Band", + "description": "Collection 2 Level-2 Blue Band (SR_B2) Surface Reflectance", + "eo:bands": [ + { + "name": "OLI_B2", + "common_name": "blue", + "description": "Visible blue", + "center_wavelength": 0.48, + "full_width_half_max": 0.06 + } + ], + "raster:bands": [ + { + "nodata": 0, + "data_type": "uint16", + "spatial_resolution": 30, + "scale": 0.0000275, + "offset": -0.2 + } + ], + "roles": [ + "data", + "reflectance" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "green": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_SR_B3.TIF", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "Green Band", + "description": "Collection 2 Level-2 Green Band (SR_B3) Surface Reflectance", + "eo:bands": [ + { + "name": "OLI_B3", + "common_name": "green", + "description": "Visible green", + "center_wavelength": 0.56, + "full_width_half_max": 0.06 + } + ], + "raster:bands": [ + { + "nodata": 0, + "data_type": "uint16", + "spatial_resolution": 30, + "scale": 0.0000275, + "offset": -0.2 + } + ], + "roles": [ + "data", + "reflectance" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "red": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_SR_B4.TIF", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "Red Band", + "description": "Collection 2 Level-2 Red Band (SR_B4) Surface Reflectance", + "eo:bands": [ + { + "name": "OLI_B4", + "common_name": "red", + "description": "Visible red", + "center_wavelength": 0.65, + "full_width_half_max": 0.04 + } + ], + "raster:bands": [ + { + "nodata": 0, + "data_type": "uint16", + "spatial_resolution": 30, + "scale": 0.0000275, + "offset": -0.2 + } + ], + "roles": [ + "data", + "reflectance" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "nir08": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_SR_B5.TIF", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "Near Infrared Band 0.8", + "description": "Collection 2 Level-2 Near Infrared Band 0.8 (SR_B5) Surface Reflectance", + "eo:bands": [ + { + "name": "OLI_B5", + "common_name": "nir08", + "description": "Near infrared", + "center_wavelength": 0.87, + "full_width_half_max": 0.03 + } + ], + "raster:bands": [ + { + "nodata": 0, + "data_type": "uint16", + "spatial_resolution": 30, + "scale": 0.0000275, + "offset": -0.2 + } + ], + "roles": [ + "data", + "reflectance" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "swir16": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_SR_B6.TIF", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "Short-wave Infrared Band 1.6", + "description": "Collection 2 Level-2 Short-wave Infrared Band 1.6 (SR_B6) Surface Reflectance", + "eo:bands": [ + { + "name": "OLI_B6", + "common_name": "swir16", + "description": "Short-wave infrared", + "center_wavelength": 1.61, + "full_width_half_max": 0.09 + } + ], + "raster:bands": [ + { + "nodata": 0, + "data_type": "uint16", + "spatial_resolution": 30, + "scale": 0.0000275, + "offset": -0.2 + } + ], + "roles": [ + "data", + "reflectance" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "swir22": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_SR_B7.TIF", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "Short-wave Infrared Band 2.2", + "description": "Collection 2 Level-2 Short-wave Infrared Band 2.2 (SR_B7) Surface Reflectance", + "eo:bands": [ + { + "name": "OLI_B7", + "common_name": "swir22", + "description": "Short-wave infrared", + "center_wavelength": 2.2, + "full_width_half_max": 0.19 + } + ], + "raster:bands": [ + { + "nodata": 0, + "data_type": "uint16", + "spatial_resolution": 30, + "scale": 0.0000275, + "offset": -0.2 + } + ], + "roles": [ + "data", + "reflectance" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true + }, + "qa_aerosol": { + "href": "s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/145/060/LC09_L2SR_145060_20230307_20230309_02_T1/LC09_L2SR_145060_20230307_20230309_02_T1_SR_QA_AEROSOL.TIF", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "Aerosol Quality Assessment Band", + "description": "Collection 2 Level-2 Aerosol Quality Assessment Band (SR_QA_AEROSOL) Surface Reflectance Product", + "classification:bitfields": [ + { + "name": "fill", + "description": "Image or fill data", + "offset": 0, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_fill", + "description": "Pixel is not fill" + }, + { + "value": 1, + "name": "fill", + "description": "Pixel is fill" + } + ] + }, + { + "name": "retrieval", + "description": "Valid aerosol retrieval", + "offset": 1, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_valid", + "description": "Pixel retrieval is not valid" + }, + { + "value": 1, + "name": "valid", + "description": "Pixel retrieval is valid" + } + ] + }, + { + "name": "water", + "description": "Water mask", + "offset": 2, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_water", + "description": "Pixel is not water" + }, + { + "value": 1, + "name": "water", + "description": "Pixel is water" + } + ] + }, + { + "name": "interpolated", + "description": "Aerosol interpolation", + "offset": 5, + "length": 1, + "classes": [ + { + "value": 0, + "name": "not_interpolated", + "description": "Pixel is not interpolated aerosol" + }, + { + "value": 1, + "name": "interpolated", + "description": "Pixel is interpolated aerosol" + } + ] + }, + { + "name": "level", + "description": "Aerosol level", + "offset": 6, + "length": 2, + "classes": [ + { + "value": 0, + "name": "climatology", + "description": "No aerosol correction applied" + }, + { + "value": 1, + "name": "low", + "description": "Low aerosol level" + }, + { + "value": 2, + "name": "medium", + "description": "Medium aerosol level" + }, + { + "value": 3, + "name": "high", + "description": "High aerosol level" + } + ] + } + ], + "raster:bands": [ + { + "nodata": 1, + "data_type": "uint8", + "spatial_resolution": 30, + "unit": "bit index" + } + ], + "roles": [ + "data-mask", + "water-mask" + ], + "storage:platform": "AWS", + "storage:region": "us-west-2", + "storage:requester_pays": true } - } -} + }, + "bbox": [ + 71.901335, + -1.053066, + 73.946775, + 1.044926 + ], + "stac_extensions": [ + "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", + "https://stac-extensions.github.io/processing/v1.1.0/schema.json", + "https://stac-extensions.github.io/raster/v1.1.0/schema.json", + "https://stac-extensions.github.io/projection/v1.0.0/schema.json", + "https://stac-extensions.github.io/eo/v1.0.0/schema.json", + "https://landsat.usgs.gov/stac/landsat-extension/v1.1.1/schema.json", + "https://stac-extensions.github.io/classification/v1.0.0/schema.json", + "https://stac-extensions.github.io/storage/v1.0.0/schema.json", + "https://stac-extensions.github.io/view/v1.0.0/schema.json" + ], + "collection": "landsat-c2-l2" +} \ No newline at end of file diff --git a/json-schema/schema.json b/json-schema/schema.json index 8eae23b..fbeb31d 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -1,209 +1,128 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://stac-extensions.github.io/template/v1.0.0/schema.json#", - "title": "Template Extension", - "description": "STAC Template Extension for STAC Items and STAC Collections.", - "oneOf": [ - { - "$comment": "This is the schema for STAC Items. Remove this object if this extension only applies to Collections.", - "allOf": [ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://stac-extensions.github.io/landsat/v2.0.0/schema.json", + "title": "Landsat Extension", + "description": "Landsat Extension to STAC Items and STAC Collections.", + "allOf": [ { - "$ref": "#/definitions/stac_extensions" - }, - { - "type": "object", - "required": [ - "type", - "properties", - "assets" - ], - "properties": { - "type": { - "const": "Feature" - }, + "type": "object", + "required": [ + "type", + "properties", + "assets" + ], "properties": { - "allOf": [ - { - "$comment": "Require fields here for Item Properties.", - "required": [ - "template:new_field" - ] + "type": { + "const": "Feature" }, - { - "$ref": "#/definitions/fields" - } - ] - }, - "assets": { - "$comment": "This validates the fields in Item Assets, but does not require them.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/fields" - } - } - } - } - ] - }, - { - "$comment": "This is the schema for STAC Collections.", - "type": "object", - "allOf": [ - { - "required": [ - "type" - ], - "properties": { - "type": { - "const": "Collection" - } - } - }, - { - "$ref": "#/definitions/stac_extensions" - } - ], - "anyOf": [ - { - "$comment": "This is the schema for the top-level fields in a Collection. Remove this if this extension does not define top-level fields for Collections.", - "allOf": [ - { - "$comment": "Require fields here for Collections (top-level).", - "required": [ - "template:new_field" - ] - }, - { - "$ref": "#/definitions/fields" - } - ] - }, - { - "$comment": "This validates the fields in Collection Assets, but does not require them.", - "required": [ - "assets" - ], - "properties": { - "assets": { - "type": "object", - "not": { - "additionalProperties": { - "not": { - "allOf": [ - { - "$ref": "#/definitions/require_any_field" - }, - { - "$ref": "#/definitions/fields" - } - ] - } - } - } - } - } - }, - { - "$comment": "This is the schema for the fields in Item Asset Definitions. It doesn't require any fields.", - "required": [ - "item_assets" - ], - "properties": { - "item_assets": { - "type": "object", - "not": { - "additionalProperties": { - "not": { + "collection": { + "type": "string" + }, + "properties": { "allOf": [ - { - "$ref": "#/definitions/require_any_field" - }, - { - "$ref": "#/definitions/fields" - } + { + "required": [ + "landsat:scene_id", + "landsat:collection_category", + "landsat:collection_number", + "landsat:wrs_type", + "landsat:wrs_path", + "landsat:wrs_row", + "landsat:cloud_cover_land", + "landsat:correction" + ] + }, + { + "$ref": "#/definitions/fields" + } ] - } } - } } - } }, { - "$comment": "This is the schema for the fields in Summaries. By default, only checks the existence of the properties, but not the schema of the summaries.", - "required": [ - "summaries" - ], - "properties": { - "summaries": { - "$ref": "#/definitions/require_any_field" - } - } + "$ref": "#/definitions/stac_extensions" } - ] - } - ], - "definitions": { - "stac_extensions": { - "type": "object", - "required": [ - "stac_extensions" - ], - "properties": { + ], + "definitions": { "stac_extensions": { - "type": "array", - "contains": { - "const": "https://stac-extensions.github.io/template/v1.0.0/schema.json" - } - } - } - }, - "require_any_field": { - "$comment": "Please list all fields here so that we can force the existence of one of them in other parts of the schemas.", - "anyOf": [ - {"required": ["template:new_field"]}, - {"required": ["template:xyz"]}, - {"required": ["template:another_one"]} - ] - }, - "fields": { - "$comment": "Add your new fields here. Don't require them here, do that above in the corresponding schema.", - "type": "object", - "properties": { - "template:new_field": { - "type": "string" + "type": "object", + "required": [ + "stac_extensions" + ], + "properties": { + "stac_extensions": { + "type": "array", + "contains": { + "const": "https://stac-extensions.github.io/landsat/v2.0.0/schema.json" + } + } + } }, - "template:xyz": { - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number" + "fields": { + "landsat:scene_id": { + "title": "Landsat Scene Identifier", + "type": "string", + "pattern": "^L[CEMOT][1-9][0-9]{3}[0-9]{3}[0-9]{7}[A-Z]{3}[0-9]{2}$" + }, + "landsat:collection_category": { + "title": "Collection Category", + "type": "string", + "enum": [ + "A1", + "A2", + "T1", + "T2", + "RT" + ] + }, + "landsat:collection_number": { + "title": "Collection Number", + "type": "string", + "enum": [ + "01", + "02" + ] + }, + "landsat:wrs_type": { + "title": "WRS Type", + "type": "string", + "enum": [ + "1", + "2" + ] + }, + "landsat:wrs_path": { + "title": "WRS Path", + "type": "string", + "pattern": "^(0{2}[1-9])$|^(0[1-9][0-9])$|^(1[0-9]{2})$|^(2[0-2][0-9]|23[0-3])$" }, - "y": { - "type": "number" + "landsat:wrs_row": { + "title": "WRS Row", + "type": "string", + "pattern": "^(0{2}[1-9])$|^(0[1-9][0-9])$|^(1[0-9]{2})$|^(2[0-3][0-9]|24[0-8])$" }, - "z": { - "type": "number" + "landsat:cloud_cover_land": { + "title": "Land Cloud Cover", + "type": "number", + "minimum": -1, + "maximum": 100 + }, + "landsat:correction": { + "title": "Product Correction Level", + "type": "string", + "enum": [ + "L1TP", + "L1GT", + "L1GS", + "L2SR", + "L2SP" + ] + }, + "landsat:product_generated": { + "title": "Product Generated Datetime", + "type": "string", + "format": "date-time" } - } - }, - "template:another_one": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "patternProperties": { - "^(?!template:)": { - "$comment": "Above, change `template` to the prefix of this extension" } - }, - "additionalProperties": false } - } -} +} \ No newline at end of file diff --git a/package.json b/package.json index c8eee26..e3af4d9 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { - "name": "stac-extension-template", + "name": "stac-extension-landsat", "version": "1.0.0", "scripts": { "test": "npm run check-markdown && npm run check-examples", "check-markdown": "remark . -f -r .github/remark.yaml", - "check-examples": "stac-node-validator . --lint --verbose --schemaMap https://stac-extensions.github.io/template/v1.0.0/schema.json=./json-schema/schema.json", - "format-examples": "stac-node-validator . --format --schemaMap https://stac-extensions.github.io/template/v1.0.0/schema.json=./json-schema/schema.json" + "check-examples": "stac-node-validator . --lint --verbose --schemaMap https://stac-extensions.github.io/landsat/v2.0.0/schema.json=./json-schema/schema.json", + "format-examples": "stac-node-validator . --format --schemaMap https://stac-extensions.github.io/landsat/v2.0.0/schema.json=./json-schema/schema.json" }, "dependencies": { "remark-cli": "^12.0.0",