Skip to content

Commit

Permalink
fix: update schema to The New Way
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Aug 21, 2024
1 parent db4d958 commit 70f13f1
Showing 1 changed file with 97 additions and 64 deletions.
161 changes: 97 additions & 64 deletions json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"$id": "https://stac-extensions.github.io/pointcloud/v2.0.0/schema.json#",
"title": "Point Cloud Extension",
"description": "STAC Point Cloud Extension for STAC Items and Collections.",
"type": "object",
"required": [
"stac_extensions"
"stac_extensions",
"type"
],
"properties": {
"stac_extensions": {
Expand All @@ -14,85 +16,84 @@
}
}
},
"oneOf": [
"allOf": [
{
"$comment": "This is the schema for STAC Items.",
"allOf": [
{
"type": "object",
"required": [
"type",
"properties",
"assets"
],
"$comment": "Item",
"if": {
"properties": {
"type": {
"const": "Feature"
}
}
},
"then": {
"properties": {
"properties": {
"type": {
"const": "Feature"
},
"properties": {
"allOf": [
{
"$comment": "Require fields here for item properties.",
"required": [
"pc:count",
"pc:type"
]
},
{
"$ref": "#/definitions/fields"
}
]
},
"assets": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/fields"
}
}
"$ref": "#/definitions/fields"
}
}
]
}
},
{
"$comment": "This is the schema for STAC Collections.",
"allOf": [
{
"type": "object",
"required": [
"type"
],
"$comment": "Collections",
"if": {
"properties": {
"type": {
"const": "Collection"
}
}
},
"then": {
"properties": {
"properties": {
"type": {
"const": "Collection"
},
"assets": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/fields"
}
},
"item_assets": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/fields"
}
}
"$ref": "#/definitions/fields"
}
}
]
}
}
],
"definitions": {
"require_assets": {
"required": [
"assets"
],
"properties": {
"assets": {
"$ref": "#/definitions/asset_contains"
}
}
},
"validate_assets": {
"properties": {
"assets": {
"additionalProperties": {
"$ref": "#/definitions/fields"
}
}
}
},
"asset_contains": {
"type": "object",
"not": {
"additionalProperties": {
"not": {
"$ref": "#/definitions/fields"
}
}
}
},
"fields": {
"type": "object",
"required": [
"pc:count",
"pc:type"
],
"properties": {
"pc:count": {
"type": "integer",
"minimum": 0
"$ref": "#/definitions/pc:count"
},
"pc:type": {
"type": "string",
"minLength": 1
"$ref": "#/definitions/pc:type"
},
"pc:schemas": {
"type": "array",
Expand All @@ -102,8 +103,7 @@
}
},
"pc:density": {
"type": "number",
"minimum": 0
"$ref": "#/definitions/pc:density"
},
"pc:statistics": {
"type": "array",
Expand All @@ -118,7 +118,39 @@
},
"additionalProperties": false
},
"pc:count": {
"title": "The number of points",
"type": "integer",
"minimum": 0
},
"pc:type": {
"title": "Phenomenology type for the point cloud",
"type": "string",
"minLength": 1
},
"pc:schemas": {
"title": "A sequential array of Items that define the dimensions and their types",
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/schema"
}
},
"pc:density": {
"title": "Number of points per square unit area",
"type": "number",
"minimum": 0
},
"pc:statistics": {
"title": "A sequential array of Items mapping to pc:schemas defines per-channel statistics",
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/stats"
}
},
"schema": {
"title": "A sequential array of Items that define the dimensions or channels of the point cloud, their types, and their sizes (in full bytes)",
"type": "object",
"required": [
"name",
Expand All @@ -144,6 +176,7 @@
}
},
"stats": {
"title": "A sequential array of Items mapping to pc:schemas defines per-channel statistics",
"type": "object",
"minProperties": 2,
"required": [
Expand Down

0 comments on commit 70f13f1

Please sign in to comment.