Skip to content

Commit

Permalink
Basic geometry schema
Browse files Browse the repository at this point in the history
  • Loading branch information
gino-m committed Jan 24, 2024
1 parent 07dab2a commit 1ba2f23
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://groundplatform.org/schema/geometry/nested-coordinates.schema.json",
"$comment": "Converted to GeoPoint in Firestore representation as an optimization.",
"title": "Coordinates",
"type": "object",
"required": [
"latitude",
"longitude"
],
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://groundplatform.org/schema/geometry/nested-geometry.schema.json",
"title": "Geometry",
"oneOf": [
{ "$ref": "https://groundplatform.org/schema/geometry/nested-point.schema.json" },
{ "$ref": "https://groundplatform.org/schema/geometry/nested-polygon.schema.json" }
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://groundplatform.org/schema/geometry/nested-linear-ring.schema.json",
"title": "Linear Ring",
"type": "object",
"required": [
"coordinates"
],
"properties": {
"coordinates": {
"type": "array",
"items": {
"$ref": "https://groundplatform.org/schema/geometry/nested-coordinates.schema.json"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://groundplatform.org/schema/geometry/nested-point.schema.json",
"title": "Point",
"type": "object",
"required": [
"type",
"coordinates"
],
"properties": {
"type": {
"type": "string",
"enum": [
"Point"
]
},
"coordinates": {
"$ref": "https://groundplatform.org/schema/geometry/nested-coordinates.schema.json"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://groundplatform.org/schema/geometry/nested-polygon.schema.json",
"title": "Polygon",
"type": "object",
"required": [
"type",
"shell"
],
"properties": {
"type": {
"type": "string",
"enum": [
"Polygon"
]
},
"shell": {
"$ref": "https://groundplatform.org/schema/geometry/nested-linear-ring.schema.json"
},
"holes": {
"type": "array",
"items": {
"$ref": "https://groundplatform.org/schema/geometry/nested-linear-ring.schema.json"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$id": "https://groundplatform.org/loi-document.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://groundplatform.org/schema/loi/loi-document.schema.json",
"title": "Location of Interest",
"type": "object",
"properties": {
Expand All @@ -11,8 +11,7 @@
"type": "string"
},
"geometry": {
"type": "object",
"x-kt-type": "map"
"$ref": "https://groundplatform.org/schema/geometry/nested-geometry.schema.json"
},
"properties": {
"type": "object",
Expand Down

0 comments on commit 1ba2f23

Please sign in to comment.