Skip to content

Commit 14a1b63

Browse files
Merge pull request #19 from stac-extensions/nodatavalues
Add "inf" and "nan" as valid nodata values
2 parents 1efa9fb + ee5f691 commit 14a1b63

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11+
- Allow "inf" and "nan" as valid nodata values [#18](https://github.com/stac-extensions/raster/issues/18)
12+
1113
### Changed
1214

1315
### Deprecated

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ to specify information about the raster projection, especially `proj:shape` to s
3535

3636
| Field Name | Type | Description |
3737
| ------------------ | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
38-
| nodata | number | Pixel values used to identify pixels that are nodata in the band . |
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`. |
3939
| 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. |
4040
| data_type | string | The data type of the pixels in the band. One of the [data types as described above](#data-types). |
4141
| 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 |

examples/item-sentinel2.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,13 @@
562562
"full_width_half_max": 0.026
563563
}
564564
],
565+
"raster:bands": [
566+
{
567+
"data_type": "uint16",
568+
"spatial_resolution": 60,
569+
"nodata": "nan"
570+
}
571+
],
565572
"href": "https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/33/S/VB/2021/2/S2B_33SVB_20210221_0_L2A/B09.tif",
566573
"proj:shape": [
567574
1830,

json-schema/schema.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,19 @@
132132
},
133133
"nodata": {
134134
"title": "No data pixel value",
135-
"type": "number"
135+
"oneOf": [
136+
{
137+
"type": "number"
138+
},
139+
{
140+
"type": "string",
141+
"enum": [
142+
"nan",
143+
"inf",
144+
"-inf"
145+
]
146+
}
147+
]
136148
},
137149
"scale": {
138150
"title": "multiplicator factor of the pixel value to transform into the value",

0 commit comments

Comments
 (0)