diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 87f33a5..dbe73cf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,12 +3,11 @@ on: [push, pull_request] jobs: deploy: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [14.x] steps: - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 + with: + node-version: 'lts/*' - uses: actions/checkout@v2 - run: | npm install - npm test \ No newline at end of file + npm test diff --git a/README.md b/README.md index f5b33b2..876a2d4 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,62 @@ # Template Extension Specification -- **Title:** Template -- **Identifier:** -- **Field Name Prefix:** template +- **Title:** Classification +- **Identifier:** +- **Field Name Prefix:** classification - **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 +- **Owner**: @drwelby @mmohr @pjhartzell -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 Classification 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) + - [Asset example](examples/asset-single-band.json): Shows the basic usage of the extension in a STAC Item +- [JSON Schema](json-schema/schema.json) (TODO) - [Changelog](./CHANGELOG.md) -## Item Properties and Collection Fields +## Classification Types -| 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 | +| ----------------------- | ------------------- | ----------- | +| classification:classed | `Classed` | **REQUIRED**. Classes in the dataset | -### Additional Field Information +| Field Name | Type | Description | +| ------------------------ | ------------------ | ----------- | +| classification:bitmask | `[Bitmask]` | **REQUIRED**. Classes in the dataset | -#### template:new_field +### Classed Object -This is a much more detailed description of the field `template:new_field`... +*Describes multiple classes* -### XYZ Object +| Field Name | Type | Description | +| ----------------- | ------------ | ----------- | +| classes | `[Value]` | **REQUIRED** Classes in the classification | +| role | `string` | see [https://github.com/radiantearth/stac-spec/pull/989] | -This is the introduction for the purpose and the content of the XYZ Object... +### Bitmask 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... | +*Describes multiple classes stored in a bit range* -## Relation types +| Field Name | Type | Description | +| --------------- | -------------- | ----------- | +| bits | `[integer]` | **REQUIRED** Bits used to generate class values | +| endianess | `??` | Byte order (HALP) | +| role | `string` | see [https://github.com/radiantearth/stac-spec/pull/989] | +| classes | `[Class]` | **REQUIRED** Classes in the classification | +| description | `string` | A short description of the value(s). | -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). +### Class Object -| Type | Description | -| ------------------- | ----------- | -| fancy-rel-type | This link points to a fancy resource. | +*Describes data class* + +| Field Name | Type | Description | +| -------------- | -------------------- | ----------- | +| value | `Any` | **REQUIRED** Value of class | +| description | `string` | **REQUIRED** Description of class | +| name | `string` | Short name of the class for machine readibility, optional | +| color-hint | `RGB string or null` | suggested color for rendering, `null` means do not render | + +_`value: any` leaves it open for ranges but hopefully that can be discouraged!_ ## Contributing diff --git a/examples/asset-single-band.json b/examples/asset-single-band.json new file mode 100644 index 0000000..7e68b50 --- /dev/null +++ b/examples/asset-single-band.json @@ -0,0 +1,61 @@ +"cloud-mask-raster": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "Cloud/Cloud Shadow Coverage Raster", + "description": "thematic raster, 0 -> no data, 1 -> clear, 2 -> cloud, 3 -> cloud shadow", + "href": "./103001000AC5B000-clouds.tif", + "proj:bbox": [ + 619843.75, + 8889843.75, + 625156.25, + 8895156.25 + ], + "proj:shape": [ + 2176, + 2176 + ], + "proj:transform": [ + 2.44140625, + 0.0, + 619843.75, + 0.0, + -2.44140625, + 8895156.25, + 0.0, + 0.0, + 1.0 + ], + "eo:bands": [ + { + "name": "BAND_CM", + "description": "Clouds/Cloud Shadows Mask", + "classification:classed": { + "role": "cloud, cloud_shadow", + "classes": [ + { + "value": 0, + "name": "nodata", + "description": "NoData" + }, + { + "value": 1, + "name": "clear", + "description": "Clear of clouds or shadows", + "color-hint": null // do not render + }, + { + "value": 2, + "name": "cloud", + "description": "Clouds", + "color-hint": "#B8D0EC" + }, + { + "value": 3, + "name": "cloud_shadow", + "description": "Cloud shadows", + "color-hint": "9C9EA0" + }, + ] + } + } + ] +} \ No newline at end of file diff --git a/examples/collection.json b/examples/collection.json deleted file mode 100644 index 0e36c98..0000000 --- a/examples/collection.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "stac_version": "1.0.0-rc.1", - "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" - } - ] -} \ No newline at end of file diff --git a/examples/item.json b/examples/item.json deleted file mode 100644 index 06905fd..0000000 --- a/examples/item.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "stac_version": "1.0.0-rc.1", - "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 - ], - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 172.9, - 1.3 - ], - [ - 173, - 1.3 - ], - [ - 173, - 1.4 - ], - [ - 172.9, - 1.4 - ], - [ - 172.9, - 1.3 - ] - ] - ] - }, - "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" - } - ], - "assets": { - "data": { - "href": "https://example.com/examples/file.xyz", - "template:new_field": "test" - } - } -} \ No newline at end of file