Skip to content

Commit 5e1f010

Browse files
Update to use STAC 1.1 bands (#45)
* update field names * update scale and offset examples and fix KaTeX formulas * updated CHANGELOG * update items using bands instead of raster:bands * update CHANGELOG * updaed schema to use STAC 1.1 bands * Revert "update scale and offset examples and fix KaTeX formulas" This reverts commit 24c3e48. * Fix examples and schema * Simplify examples * Update README and Changelog * Update version number of eo extension --------- Co-authored-by: Matthias Mohr <[email protected]>
1 parent 9187cf2 commit 5e1f010

File tree

5 files changed

+374
-733
lines changed

5 files changed

+374
-733
lines changed

CHANGELOG.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
@@ -8,11 +9,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
89

910
### Added
1011

11-
- Add link `rel="gcps"` to Ground Control Points document
12+
- Add link relation type `gcps` for Ground Control Points documents
13+
- `raster:sampling`, `raster:bits_per_sample`, `raster:spatial_resolution`, `raster:scale`, `raster:offset` and `raster:histogram`
14+
can be used in Assets and Item Properties
1215

1316
### Changed
1417

15-
- Some clarifications abd fixes in the README and examples [#41](https://github.com/stac-extensions/raster/pull/41)
18+
- Some clarifications and fixes in the README and examples [#41](https://github.com/stac-extensions/raster/pull/41)
19+
- `raster:bands` is now using the more general `bands` construct from STAC common metadata
20+
- The following fields in the Band Object have been moved/renamed:
21+
- `nodata`, `data_type`, `statistics` and `unit` were *not* renamed, but have been moved to STAC common metadata
22+
- `sampling` has been renamed to `raster:sampling`
23+
- `bits_per_sample` has been renamed to `raster:bits_per_sample`
24+
- `spatial_resolution` has been renamed to `raster:spatial_resolution`
25+
- `scale` has been renamed to `raster:scale`
26+
- `offset` has been renamed to `raster:offset`
27+
- `histogram` has been renamed to `raster:histogram`
28+
29+
### Removed
30+
31+
- `raster:bands` - use `bands` in instead
1632

1733
## [v1.1.0]
1834

README.md

+23-64
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
This document explains the Raster Extension to the [SpatioTemporal Asset Catalog](https://github.com/radiantearth/stac-spec) (STAC) specification.
1111

1212
An item can describe assets that are rasters of one or multiple bands with some information common to them all (raster size, projection)
13-
and also specific to each of them (data type, unit, number of bits used, nodata).
13+
and also specific to each of them (number of bits used).
1414
A raster is often strongly linked with the georeferencing transform and coordinate system definition
1515
of all bands (using the [projection extension](https://github.com/radiantearth/stac-spec/tree/master/extensions/projection)).
1616
In many applications, it is interesting to have some metadata about the rasters in the asset (values statistics, value interpretation, transforms).
@@ -21,72 +21,31 @@ In many applications, it is interesting to have some metadata about the rasters
2121
- [JSON Schema](json-schema/schema.json)
2222
- [Changelog](./CHANGELOG.md)
2323

24-
## Item Asset fields
24+
## Fields
2525

26-
| Field Name | Type | Description |
27-
| ------------ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
28-
| raster:bands | \[[Raster band Object](#raster-band-object)] | An array of available bands where each object is a \[[Band Object](#raster-band-object)]. If given, requires at least one band. |
26+
The fields in the table below can be used in these parts of STAC documents:
2927

30-
## Raster Band Object
28+
- [ ] Catalogs
29+
- [ ] Collections
30+
- [x] Item Properties (incl. Summaries in Collections)
31+
- [x] Assets (for both Collections and Items, incl. Item Asset Definitions in Collections)
32+
- [x] Bands
33+
- [ ] Links
3134

32-
When specifying a raster band object at asset level, it is recommended to use
35+
When using the raster extension, it is recommended to use
3336
the [projection](https://github.com/radiantearth/stac-spec/tree/master/extensions/projection) extension
3437
to specify information about the raster projection, especially `proj:shape` to specify the height and width of the raster.
3538

3639
| Field Name | Type | Description |
3740
| ------------------ | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
38-
| nodata | number\|string | Pixel values used to identify pixels that are nodata in the band either by the pixel value as a number or `nan`, `inf` or `-inf` (all strings). |
39-
| sampling | string | One of `area` or `point`. Indicates whether a pixel value should be assumed to represent a sampling over the region of the pixel or a point sample at the center of the pixel. |
40-
| data_type | string | The data type of the pixels in the band. One of the [data types as described below](#data-types). |
41-
| bits_per_sample | number | The actual number of bits used for this band. Normally only present when the number of bits is non-standard for the `datatype`, such as when a 1 bit TIFF is represented as byte. |
42-
| spatial_resolution | number | Average spatial resolution (in meters) of the pixels in the band. |
43-
| statistics | [Statistics Object](#statistics-object) | Statistics of all the pixels in the band. |
44-
| unit | string | Unit denomination of the pixel value. |
45-
| scale | number | Multiplicator factor of the pixel value to transform into the value (i.e. translate digital number to reflectance). |
46-
| offset | number | Number to be added to the pixel value (after scaling) to transform into the value (i.e. translate digital number to reflectance). |
47-
| histogram | [Histogram Object](#histogram-object) | Histogram distribution information of the pixels values in the band. |
48-
49-
`scale` and `offset` define parameters to compute another value. The following paragraphs describe some use cases.
50-
51-
### Data Types
52-
53-
The data type gives information about the values in the file.
54-
This can be used to indicate the (maximum) range of numerical values expected.
55-
For example `uint8` indicates that the numbers are in a range between 0 and 255,
56-
they can never be smaller or larger. This can help to pick the optimal numerical
57-
data type when reading the files to keep memory consumption low.
58-
Nevertheless, it doesn't necessarily mean that the expected values fill the whole range.
59-
For example, there can be use cases for `uint8` that just use the numbers 0 to 10 for example.
60-
Through other extensions it might be possible to specify an exact value range so
61-
that visualizations can be optimized.
62-
The allowed values for `data_type` are:
63-
64-
- `int8`: 8-bit integer
65-
- `int16`: 16-bit integer
66-
- `int32`: 32-bit integer
67-
- `int64`: 64-bit integer
68-
- `uint8`: unsigned 8-bit integer (common for 8-bit RGB PNG's)
69-
- `uint16`: unsigned 16-bit integer
70-
- `uint32`: unsigned 32-bit integer
71-
- `uint64`: unsigned 64-bit integer
72-
- `float16`: 16-bit float
73-
- `float32`: 32-bit float
74-
- `float64`: 64-big float
75-
- `cint16`: 16-bit complex integer
76-
- `cint32`: 32-bit complex integer
77-
- `cfloat32`: 32-bit complex float
78-
- `cfloat64`: 64-bit complex float
79-
- `other`: Other data type than the ones listed above (e.g. boolean, string, higher precision numbers)
80-
81-
### Statistics Object
82-
83-
| Field Name | Type | Description |
84-
| ------------- | ------ | -------------------------------------------------- |
85-
| mean | number | mean value of all the pixels in the band |
86-
| minimum | number | minimum value of the pixels in the band |
87-
| maximum | number | maximum value of the pixels in the band |
88-
| stddev | number | standard deviation value of the pixels in the band |
89-
| valid_percent | number | percentage of valid (not `nodata`) pixel |
41+
| raster:sampling | string | One of `area` or `point`. Indicates whether a pixel value should be assumed to represent a sampling over the region of the pixel or a point sample at the center of the pixel. |
42+
| raster:bits_per_sample | number | The actual number of bits used for this band. Normally only present when the number of bits is non-standard for the `datatype`, such as when a 1 bit TIFF is represented as byte. |
43+
| raster:spatial_resolution | number | Average spatial resolution (in meters) of the pixels in the band. |
44+
| raster:scale | number | Multiplicator factor of the pixel value to transform into the value (i.e. translate digital number to reflectance). |
45+
| raster:offset | number | Number to be added to the pixel value (after scaling) to transform into the value (i.e. translate digital number to reflectance). |
46+
| raster:histogram | [Histogram Object](#histogram-object) | Histogram distribution information of the pixels values in the band. |
47+
48+
`raster:scale` and `raster:offset` define parameters to compute another value. The following paragraphs describe some use cases.
9049

9150
### Scale and Offset Uses and Examples
9251

@@ -133,11 +92,11 @@ For example, the above value conversion is described in the values dictionary as
13392
"assets": {
13493
"B4": {
13594
"title": "TOA radiance band 4",
136-
"raster:bands": [{
95+
"bands": [{
13796
"nodata": 0,
13897
"unit": "W⋅sr−1⋅m−2",
139-
"scale": 0.0145,
140-
"offset": 3.48
98+
"raster:scale": 0.0145,
99+
"raster:offset": 3.48
141100
}]
142101
}
143102
}
@@ -172,9 +131,9 @@ In the following value definition example, 185 meters must be substracted from t
172131
"assets": {
173132
"WaterLevel": {
174133
"title": "Water Level at station",
175-
"raster:bands": [{
134+
"bands": [{
176135
"unit": "m",
177-
"offset": -185
136+
"raster:offset": -185
178137
}]
179138
}
180139
}

examples/item-planet.json

+35-57
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"stac_extensions": [
33
"https://stac-extensions.github.io/sat/v1.0.0/schema.json",
44
"https://stac-extensions.github.io/view/v1.0.0/schema.json",
5-
"https://stac-extensions.github.io/projection/v1.0.0/schema.json",
6-
"https://stac-extensions.github.io/eo/v1.0.0/schema.json",
5+
"https://stac-extensions.github.io/projection/v1.1.0/schema.json",
6+
"https://stac-extensions.github.io/eo/v2.0.0-beta.1/schema.json",
77
"https://stac-extensions.github.io/processing/v1.0.0/schema.json",
88
"https://stac-extensions.github.io/raster/v1.1.0/schema.json"
99
],
@@ -16,49 +16,30 @@
1616
"data"
1717
],
1818
"href": "PT01S00_842547E119_8697242018100100000000MS00_GG001002003/PT01S00_842547E119_8697242018100100000000MS00_GG001002003.tif",
19-
"eo:bands": [
20-
{
21-
"name": "band-1",
22-
"common_name": "red",
23-
"center_wavelength": 0.63
24-
},
25-
{
26-
"name": "band-2",
27-
"common_name": "green",
28-
"center_wavelength": 0.545
29-
},
30-
{
31-
"name": "band-3",
32-
"common_name": "blue",
33-
"center_wavelength": 0.485
34-
},
35-
{
36-
"name": "band-4",
37-
"common_name": "nir",
38-
"center_wavelength": 0.82
39-
}
40-
],
4119
"proj:shape": [
4220
8966,
4321
4411
4422
],
45-
"raster:bands": [
23+
"data_type": "uint16",
24+
"nodata": 0,
25+
"raster:sampling": "area",
26+
"raster:spatial_resolution": 3,
27+
"bands": [
4628
{
47-
"sampling": "area",
48-
"name": "Red TOA reflectance",
49-
"data_type": "uint16",
50-
"scale": 0.01,
51-
"offset": 0,
52-
"nodata": 0,
53-
"spatial_resolution": 3,
29+
"name": "band-1",
30+
"description": "Red TOA reflectance",
5431
"statistics": {
5532
"maximum": 32925,
5633
"mean": 8498.9400644319,
5734
"minimum": 1962,
5835
"stddev": 5056.1292002722,
5936
"valid_percent": 61.09
6037
},
61-
"histogram": {
38+
"eo:common_name": "red",
39+
"eo:center_wavelength": 0.63,
40+
"raster:scale": 0.01,
41+
"raster:offset": 0,
42+
"raster:histogram": {
6243
"count": 256,
6344
"min": 1901.288235294118,
6445
"max": 32985.71176470588,
@@ -323,21 +304,20 @@
323304
}
324305
},
325306
{
326-
"sampling": "area",
327-
"name": "Green TOA reflectance",
328-
"data_type": "uint16",
329-
"scale": 0.0000196236732904,
330-
"offset": 0,
331-
"nodata": 0,
332-
"spatial_resolution": 3,
307+
"name": "band-2",
308+
"description": "Green TOA reflectance",
333309
"statistics": {
334310
"maximum": 22063,
335311
"mean": 7185.2123645206,
336312
"minimum": 3884,
337313
"stddev": 3799.4562788636,
338314
"valid_percent": 61.09
339315
},
340-
"histogram": {
316+
"eo:common_name": "green",
317+
"eo:center_wavelength": 0.545,
318+
"raster:scale": 0.0000196236732904,
319+
"raster:offset": 0,
320+
"raster:histogram": {
341321
"count": 256,
342322
"min": 3848.354901960784,
343323
"max": 22098.64509803921,
@@ -602,21 +582,20 @@
602582
}
603583
},
604584
{
605-
"sampling": "area",
606-
"name": "Blue TOA reflectance",
607-
"data_type": "uint16",
608-
"scale": 0.0000218499248607,
609-
"offset": 0,
610-
"nodata": 0,
611-
"spatial_resolution": 3,
585+
"name": "band-3",
586+
"description": "Blue TOA reflectance",
612587
"statistics": {
613588
"maximum": 29693,
614589
"mean": 5829.583942362,
615590
"minimum": 1061,
616591
"stddev": 4683.0650025253,
617592
"valid_percent": 61.09
618593
},
619-
"histogram": {
594+
"eo:common_name": "blue",
595+
"eo:center_wavelength": 0.485,
596+
"raster:scale": 0.0000218499248607,
597+
"raster:offset": 0,
598+
"raster:histogram": {
620599
"count": 256,
621600
"min": 1004.858823529412,
622601
"max": 29749.14117647059,
@@ -881,21 +860,20 @@
881860
}
882861
},
883862
{
884-
"sampling": "area",
885-
"name": "NIR TOA reflectance",
886-
"data_type": "uint16",
887-
"scale": 0.0000218499248607,
888-
"offset": 0,
889-
"nodata": 0,
890-
"spatial_resolution": 3,
863+
"name": "band-4",
864+
"description": "NIR TOA reflectance",
891865
"statistics": {
892866
"maximum": 31836,
893867
"mean": 6785.2511255265,
894868
"minimum": 1685,
895869
"stddev": 3842.4324936707,
896870
"valid_percent": 61.09
897871
},
898-
"histogram": {
872+
"eo:common_name": "nir",
873+
"eo:center_wavelength": 0.82,
874+
"raster:scale": 0.0000218499248607,
875+
"raster:offset": 0,
876+
"raster:histogram": {
899877
"count": 256,
900878
"min": 1625.880392156863,
901879
"max": 31895.11960784314,

0 commit comments

Comments
 (0)