Skip to content

Commit ee6f642

Browse files
authored
Merge pull request #861 from mccarthyryanc/pointcloud
adding JSON schema for pointcloud extension
2 parents 48e58b5 + 4fdabc6 commit ee6f642

File tree

3 files changed

+136
-6
lines changed

3 files changed

+136
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## [Unreleased]
88

99
### Added
10+
- JSON-schema file in the Point Cloud extension.
1011

1112
### Changes
1213

extensions/pointcloud/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ come from either active or passive sensors, and data is frequently acquired usin
1212
tools such as LiDAR or coincidence-matched imagery.
1313

1414
- [Example](examples/example-autzen.json)
15-
- JSON Schema is missing. PRs are welcome.
15+
- [JSON Schema](json-schema/schema.json)
1616

1717
## Item Fields
1818

@@ -34,21 +34,20 @@ the point cloud, their types, and their sizes (in full bytes).
3434
| ---------- | ------- | -------------------------- |
3535
| name | string | **REQUIRED.** The name of the dimension. |
3636
| size | integer | **REQUIRED.** The size of the dimension in bytes. Whole bytes only are supported. |
37-
| type | string | **REQUIRED.** Dimension type. Valid values include `floating`, `unsigned`, and `signed` |
37+
| type | string | **REQUIRED.** Dimension type. Valid values are `floating`, `unsigned`, and `signed` |
3838

3939
### Stats Object
4040

41-
A sequential array of items mapping to `pc:schemas` defines per-channel statistics. All fields
42-
are optional.
41+
A sequential array of items mapping to `pc:schemas` defines per-channel statistics. The channel name is required and at least one statistic.
4342

4443
| Field Name | Type | Description |
4544
| ---------- | ------- | ----------- |
45+
| name | string | **REQUIRED.** The name of the channel. |
46+
| position | integer | Position of the channel in the schema. |
4647
| average | number | The average of the channel. |
4748
| count | integer | The number of elements in the channel. |
4849
| maximum | number | The maximum value of the channel. |
4950
| minimum | number | The minimum value of the channel. |
50-
| name | string | The name of the channel. |
51-
| position | integer | Position of the channel in the schema. |
5251
| stddev | number | The standard deviation of the channel. |
5352
| variance | number | The variance of the channel. |
5453

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://schemas.stacspec.org/dev/extensions/pointcloud/json-schema/schema.json#",
4+
"title": "Point Cloud Extension",
5+
"description": "STAC Point Cloud Extension to a STAC Item",
6+
"allOf": [
7+
{
8+
"$ref": "../../../item-spec/json-schema/item.json"
9+
},
10+
{
11+
"$ref": "#/definitions/pointcloud"
12+
}
13+
],
14+
"definitions": {
15+
"pointcloud": {
16+
"type": "object",
17+
"required": [
18+
"stac_extensions",
19+
"properties"
20+
],
21+
"properties": {
22+
"stac_extensions": {
23+
"type": "array",
24+
"contains": {
25+
"enum": [
26+
"pointcloud",
27+
"https://schemas.stacspec.org/dev/extensions/pointcloud/json-schema/schema.json"
28+
]
29+
}
30+
},
31+
"properties": {
32+
"type": "object",
33+
"required": [
34+
"pc:count",
35+
"pc:type",
36+
"pc:encoding",
37+
"pc:schemas"
38+
],
39+
"properties": {
40+
"pc:count": {
41+
"type": "integer",
42+
"minimum": 0
43+
},
44+
"pc:type": {
45+
"type": "string"
46+
},
47+
"pc:encoding": {
48+
"type": "string"
49+
},
50+
"pc:schemas": {
51+
"type": "array",
52+
"minItems": 1,
53+
"items": {
54+
"$ref": "#/definitions/schema"
55+
}
56+
},
57+
"pc:density": {
58+
"type": "number",
59+
"minimum": 0
60+
},
61+
"pc:statistics": {
62+
"type": "array",
63+
"minItems": 1,
64+
"items": {
65+
"$ref": "#/definitions/stats"
66+
}
67+
}
68+
}
69+
}
70+
}
71+
},
72+
"schema": {
73+
"type": "object",
74+
"required": [
75+
"name",
76+
"size",
77+
"type"
78+
],
79+
"properties": {
80+
"name": {
81+
"type": "string"
82+
},
83+
"size": {
84+
"type": "integer"
85+
},
86+
"type": {
87+
"type": "string",
88+
"enum": [
89+
"floating",
90+
"unsigned",
91+
"signed"
92+
]
93+
}
94+
}
95+
},
96+
"stats": {
97+
"type": "object",
98+
"minProperties": 2,
99+
"required": [
100+
"name",
101+
],
102+
"properties": {
103+
"name": {
104+
"type": "string"
105+
},
106+
"position": {
107+
"type": "integer"
108+
},
109+
"average": {
110+
"type": "number"
111+
},
112+
"count": {
113+
"type": "integer"
114+
},
115+
"maximum": {
116+
"type": "number"
117+
},
118+
"minimum": {
119+
"type": "number"
120+
},
121+
"stddev": {
122+
"type": "number"
123+
},
124+
"variance": {
125+
"type": "number"
126+
}
127+
}
128+
}
129+
}
130+
}

0 commit comments

Comments
 (0)