Skip to content

Commit dabafb6

Browse files
committed
clean-up
1 parent a1e7139 commit dabafb6

File tree

5 files changed

+219
-253
lines changed

5 files changed

+219
-253
lines changed

.github/workflows/publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Inject env variables
10-
uses: rlespinasse/github-slug-action@v3.x
11-
- uses: actions/checkout@v2
10+
uses: rlespinasse/github-slug-action@v4
11+
- uses: actions/checkout@v4
1212
- name: deploy JSON Schema for version ${{ env.GITHUB_REF_SLUG }}
1313
uses: peaceiris/actions-gh-pages@v3
1414
with:

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ jobs:
44
deploy:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/setup-node@v2
7+
- uses: actions/setup-node@v4
88
with:
99
node-version: 'lts/*'
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v4
1111
- run: |
1212
npm install
1313
npm test

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
### Changed
1616

1717
- Allow CommonMark for the `description` fields.
18-
- `name` is required rather than `description`
18+
- `classification:classes`: `name` is required rather than `description`
1919

2020
### Fixed
2121

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This document explains the Classification Extension to the
1313
- Examples:
1414
- Asset level:
1515
- [Classes example](examples/item-classes-maxar.json): STAC Item with classified raster bands in asset (Maxar)
16-
- [Bitfields example](examples/item-bitfields-landsat.json): STAC Item with bitfields in asset (Landsat)
16+
- [Bitfields example](examples/item-bitfields-landsat.json): STAC Item with bit fields in asset (Landsat)
1717
- Collection level:
1818
- [Item Assets example](examples/collection-item-assets.json): STAC Collection using Item Assets for classed child Items
1919
- [JSON Schema](json-schema/schema.json)
@@ -35,7 +35,7 @@ or band therein. These coded values translate to classes of data with verbose de
3535
An example would be a cloud mask raster that stores values that represent image conditions in each pixel.
3636

3737
`classification:bitfields` is for classes that are stored in fields of continuous bits within the pixel's value.
38-
Files using this strategy are commonly given the name 'bitmask' or 'bit index'. The values stored are the integer
38+
Files using this strategy are commonly given the name 'bit mask' or 'bit index'. The values stored are the integer
3939
representation of the bits in the field when summed as an isolated string. Bits are always read right to left. The
4040
position of the first bit in a field is given by its offset. Therefore the first (rightmost) bit is at offset zero.
4141

@@ -51,22 +51,22 @@ These classification objects can be used in the following places:
5151

5252
*Describes multiple classes stored in a field of a continuous range of bits*
5353

54-
| Field Name | Type | Description |
55-
| ----------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------- |
56-
| offset | `integer` | **REQUIRED.** Offset to first bit in the field |
57-
| length | `integer` | **REQUIRED.** Number of bits in the field |
58-
| classes | `[Class]` | **REQUIRED.** Classes represented by the field values |
59-
| roles | `[string]` | see [Asset Roles](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#asset-roles) |
54+
| Field Name | Type | Description |
55+
| ----------- | ---------- | ------------------------------------------------------------ |
56+
| offset | `integer` | **REQUIRED.** Offset to first bit in the field |
57+
| length | `integer` | **REQUIRED.** Number of bits in the field |
58+
| classes | `[Class]` | **REQUIRED.** Classes represented by the field values |
59+
| name | `string` | Short name of the class for machine readability. Must consist only of letters, numbers, `-`, and `_` characters. |
6060
| description | `string` | A short description of the classification. [CommonMark 0.29](http://commonmark.org/) syntax MAY be used for rich text representation. |
61-
| name | `string` | Short name of the class for machine readability |
61+
| roles | `[string]` | see [Asset Roles](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#asset-roles) |
6262

6363
A Bit Field stores classes within a range of bits in a data value. The range is described by the offset of the first
6464
bit from the rightmost position, and the length of bits used to store the class values.
6565

6666
Since bit fields are often used to store data masks, they can also use optional STAC roles to identify their purpose
6767
to clients.
6868

69-
Following is a simplified example a bitfield scheme for cloud data using 4 bits. The bits are broken into 3 bit fields.
69+
Following is a simplified example a bit field scheme for cloud data using 4 bits. The bits are broken into 3 bit fields.
7070

7171
```{.txt}
7272
3210
@@ -89,20 +89,20 @@ To extract the values in a bit field from a value called `data`, you typically w
8989
This does:
9090

9191
- `data >> offset` right-shifts the bits in the `data` value `offset` number of times
92-
- `(1 << length) - 1` gives us `length` number of 1 bits going right to left, which gives us a bitmask
92+
- `(1 << length) - 1` gives us `length` number of 1 bits going right to left, which gives us a bit mask
9393
- ANDing (`&`) the values together gives the binary representation of the class value
9494

9595
An example of finding the cloud confidence class value from the 4 bit example above for the data value of integer `6`:
9696

9797
- Integer 6 is `0110` in binary
9898
- We want to extract the field at `offset:2, length:2`
9999
- First, right-shift twice (`0110 >> 2`), which results in `1001`
100-
- Next, make the bitmask, which is 2 left shifts of `0001` to get `0100` (integer 4), then subtract 1 to
100+
- Next, make the bit mask, which is 2 left shifts of `0001` to get `0100` (integer 4), then subtract 1 to
101101
get `0011` (integer 3)
102102
- AND these two values together `1001 & 0011` and you get `0001`, or integer 1
103103
- Therefore at this pixel the cloud confidence field is storing class 1
104104

105-
The key distinction with bit fields from other types of bitmasks is that the bits in the field are summed
105+
The key distinction with bit fields from other types of bit masks is that the bits in the field are summed
106106
as standalone bits. Therefore `01..` cloud confidence class uses the value of 1, not 4 (binary `0100`)
107107

108108
For a real world example, see [Landsat 8's Quality raster](https://www.usgs.gov/media/images/landsat-1-8-collection-1-level-1-quality-bit-designations).
@@ -113,12 +113,12 @@ For a real world example, see [Landsat 8's Quality raster](https://www.usgs.gov/
113113

114114
| Field Name | Type | Description |
115115
| ----------- | ---------- | -------------------------------------------------------------------------------------------------------------------- |
116-
| value | `integer` | **REQUIRED.** Value of the class |
117-
| description | `string` | Description of the class. [CommonMark 0.29](http://commonmark.org/) syntax MAY be used for rich text representation. |
118-
| name | `string` | **REQUIRED.** Short name of the class for machine readability. Must consist only of letters, numbers, `-`, and `_` characters. |
119-
| title | `string` | Human-readable name for use in, e.g., a map legend. |
120-
| color_hint | RGB string | suggested color for rendering (Hex RGB code in upper-case without leading #) |
121-
| nodata | `boolean` | If set to `true` classifies a value as a no-data value, defaults to `false` |
116+
| value | integer | **REQUIRED.** Value of the class |
117+
| name | string | **REQUIRED.** Short name of the class for machine readability. Must consist only of letters, numbers, `-`, and `_` characters. |
118+
| title | string | Human-readable name for use in, e.g., a map legend. |
119+
| description | string | Description of the class. [CommonMark 0.29](http://commonmark.org/) syntax MAY be used for rich text representation. |
120+
| color_hint | string | Suggested color for rendering (Hex RGB code in upper-case without leading #) |
121+
| nodata | boolean | If set to `true` classifies a value as a no-data value, defaults to `false` |
122122

123123
Class objects enumerate data values and their corresponding classes.
124124
A cloud mask raster could contain the following four classes:
@@ -145,7 +145,7 @@ Instructions for running tests are copied here for convenience.
145145

146146
### Running tests
147147

148-
The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes
148+
The same checks that run as checks on PRs are part of the repository and can be run locally to verify that changes
149149
are valid.
150150
To run tests locally, you'll need `npm`, which is a standard part of any
151151
[node.js installation](https://nodejs.org/en/download/).

0 commit comments

Comments
 (0)