-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Admins] Add Area type and allow only Point on Locality
With new relations we can now add multiple different geometries to one admin, here we are changing modeling for localities to always have point and in case it also has polygon adds it via new Area type which references Locality via `localityId` property.
- Loading branch information
1 parent
f571c11
commit 0e4c01d
Showing
13 changed files
with
113 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
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 AreaSchema from '!!raw-loader!@site/docs/_schema/admins/area.yaml'; | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
import AreaExample from '!!raw-loader!@site/docs/_examples/admins/area/area-admin-country-no-context.yaml'; | ||
|
||
# area | ||
|
||
Area adds land or maritime polygon to locality. | ||
|
||
<table> | ||
<tr> | ||
<th>Geometry Type</th> | ||
<td><code>Polygon</code> or <code>MultiPolygon</code></td> | ||
</tr> | ||
<tr> | ||
<th>Theme</th> | ||
<td><code>admins</code></td> | ||
</tr> | ||
<tr> | ||
<th>Type</th> | ||
<td><code>area</code></td> | ||
</tr> | ||
</table> | ||
|
||
## Schema | ||
|
||
<Tabs> | ||
<TabItem value="browsable" label="Browsable" default> | ||
<JSONSchemaViewer schema={ yamlLoad(AreaSchema) } resolverOptions={ generateResolverOptions({remote: true, yamlBasePath: '/admins'})}/> | ||
</TabItem> | ||
<TabItem value="yaml" label="YAML" default> | ||
<CodeBlock language="jsx">{AreaSchema}</CodeBlock> | ||
</TabItem> | ||
</Tabs> | ||
|
||
## Examples | ||
|
||
<Tabs> | ||
<TabItem value="area" label="Area" default> | ||
<CodeBlock language="json">{ JSON.stringify(yamlLoad(AreaExample), null, 2) }</CodeBlock> | ||
</TabItem> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
type: Feature | ||
geometry: | ||
type: MultiPolygon | ||
coordinates: | ||
- - - - -61.8743292 | ||
- 48.8068635 | ||
- - -78.4016703 | ||
- 26.273714 | ||
- - -120.7749598 | ||
- 32.2499745 | ||
- - -126.928757 | ||
- 49.0378679 | ||
- - -61.8743292 | ||
- 48.8068635 | ||
properties: | ||
theme: admins | ||
type: area | ||
updateTime: '2023-02-22T23:55:01-08:00' | ||
version: 0 | ||
localityId: unitedStates | ||
maritime: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
"$schema": https://json-schema.org/draft/2020-12/schema | ||
title: Area Schema | ||
description: >- | ||
Area adds land or maritime polygon to locality. | ||
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 | ||
required: [localityId] | ||
allOf: | ||
- "$ref": ../defs.yaml#/$defs/propertyContainers/overtureFeaturePropertiesContainer | ||
properties: | ||
localityId: | ||
description: References specific feature of locality type | ||
type: string | ||
maritime: | ||
description: Flag that specifies if the area is maritime (i.e., an area convering sea at a particular distance from a jurisdiction's coastline) | ||
type: boolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters