Skip to content

Commit

Permalink
take 2 🎥
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahadkins committed Sep 7, 2024
1 parent 1dc2df2 commit 70b87d1
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docs/schema/reference/base/bathymetry.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: bathymetry
---
import CodeBlock from '@theme/CodeBlock';
import JSONSchemaViewer from "@theme/JSONSchemaViewer";
import generateResolverOptions from "@site/src/components/shared-libs/generateResolverOptions"
import yamlLoad from "@site/src/components/yamlLoad"
import BathymetrySchema from "!!raw-loader!@site/docs/_schema/base/bathymetry.yaml";
import BathymetryExample from "!!raw-loader!@site/docs/_examples/base/bathymetry-example.yaml";
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Bathymetry
<table>
<tbody>
<tr>
<th>Geometry Type</th>
<td>
<code>Polygon</code>
</td>
</tr>
<tr>
<th>Theme</th>
<td><code>base</code></td>
</tr>
<tr>
<th>Type</th>
<td><code>bathymetry</code></td>
</tr>
</tbody>
</table>
## Schema
<Tabs>
<TabItem value="browsable" label="Browsable" default>
<JSONSchemaViewer schema={ yamlLoad(BathymetrySchema) } resolverOptions={ generateResolverOptions({remote: true, yamlBasePath: '/base'})}/>
</TabItem>
<TabItem value="yaml" label="YAML" default>
<CodeBlock language="jsx">{BathymetrySchema}</CodeBlock>
</TabItem>
</Tabs>
## Examples
<Tabs>
<TabItem value="1" label="bathymetry" default>
<CodeBlock language="json">{ JSON.stringify(yamlLoad(BathymetryExample), null, 2) }</CodeBlock>
</TabItem>
</Tabs>
20 changes: 20 additions & 0 deletions examples/base/bathymetry-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
id: "overture:bathymetry:example:1"
type: Feature
geometry:
type: Polygon
coordinates: [[[-73.1902319,41.6678018],[-73.1896302,41.667817],[-73.1890448,41.6667723],[-73.1899188,41.6666994],[-73.1902319,41.6678018]]]
properties:
theme: base
type: bathymetry
depth: -2500
cartography:
min_zoom: 0
max_zoom: 23
sort_key: 7
sources:
- record_id: x123
property: ""
dataset: some source
version: 0
update_time: "2023-05-30T00:00:00Z"
23 changes: 23 additions & 0 deletions schema/base/bathymetry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
"$schema": https://json-schema.org/draft/2020-12/schema
title: bathymetry
description: topographic representation of the ocean floor
type: object
properties:
id:
"$ref": ../defs.yaml#/$defs/propertyDefinitions/id
geometry:
unevaluatedProperties: false
oneOf:
- "$ref": https://geojson.org/schema/Polygon.json
- "$ref": https://geojson.org/schema/MultiPolygon.json
properties:
unevaluatedProperties: false
allOf:
- "$ref": ../defs.yaml#/$defs/propertyContainers/overtureFeaturePropertiesContainer
- "$ref": ../defs.yaml#/$defs/propertyContainers/levelContainer
- "$ref": ../defs.yaml#/$defs/propertyContainers/cartographyContainer
required:
- depth
properties:
depth: { "$ref": ./defs.yaml#/$defs/propertyDefinitions/depth }
1 change: 1 addition & 0 deletions schema/defs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ description: Common schema definitions shared by all themes
type: string
enum:
- address
- bathymetry
- building
- connector
- division
Expand Down
8 changes: 8 additions & 0 deletions schema/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ oneOf:
type: { enum: [infrastructure] }
then: { "$ref": base/infrastructure.yaml }
else: { propertyNames: false }
- if:
properties:
properties:
properties:
theme: { enum: [base] }
type: { enum: [bathymetry] }
then: { "$ref": base/bathymetry.yaml }
else: { propertyNames: false }
- if:
properties:
properties:
Expand Down

0 comments on commit 70b87d1

Please sign in to comment.