Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Admins] Add Area type and allow only Point on Locality #72

Merged
merged 5 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion counterexamples/admins/locality/bad-admin-level.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"subType": "administrativeLocality",
"localityType": "country",
"adminLevel": 100,
"context": "northAmericaId",
"contextId": "northAmericaId",
"names": {
"common": [
{
Expand Down
2 changes: 1 addition & 1 deletion counterexamples/admins/locality/bad-language.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"isoCountryCodeAlpha2": "US",
"defaultLanguage": "english",
"drivingSide": "right",
"context": "northAmericaId",
"contextId": "northAmericaId",
"names": {
"common": [
{
Expand Down
2 changes: 1 addition & 1 deletion counterexamples/admins/locality/missing-locality-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"updateTime": "2023-02-22T23:55:01-08:00",
"subType": "administrativeLocality",
"adminLevel": 2,
"context": "northAmericaId",
"contextId": "northAmericaId",
"names": {
"common": [
{
Expand Down
2 changes: 1 addition & 1 deletion counterexamples/admins/locality/missing-names.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"subType": "administrativeLocality",
"localityType": "country",
"adminLevel": 2,
"context": "northAmericaId"
"contextId": "northAmericaId"
},
"geometry": {
"type": "Polygon",
Expand Down
2 changes: 1 addition & 1 deletion counterexamples/admins/locality/missing-sub-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"updateTime": "2023-02-22T23:55:01-08:00",
"localityType": "country",
"adminLevel": 2,
"context": "northAmericaId",
"contextId": "northAmericaId",
"names": {
"common": [
{
Expand Down
6 changes: 4 additions & 2 deletions docusaurus/docs/reference/admins/locality.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import AdminLocalityExample from '!!raw-loader!@site/docs/_examples/admins/local

Localities are named, and typically populated, areas.

Area polygon of Localities, if known, are given by [Locality Area](localityArea) features.

<table>
<tr>
<th>Geometry Type</th>
<td><code>Point</code>, <code>Polygon</code> or <code>MultiPolygon</code></td>
<td><code>Point</code></td>
</tr>
<tr>
<th>Theme</th>
Expand Down Expand Up @@ -44,7 +46,7 @@ subdivisions of countries.

Every Administrative Locality has a valid `adminLevel` property set,
defining its position in the subdivision hierarchy. All Administrative
Localities at sub-country level must have a `context` property
Localities at sub-country level must have a `contextId` property
containing the GERS ID of the feature's parent Administrative Locality.

The borders of Administrative Localities, if known, are given by
Expand Down
48 changes: 48 additions & 0 deletions docusaurus/docs/reference/admins/localityArea.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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 LocalityAreaSchema from '!!raw-loader!@site/docs/_schema/admins/localityArea.yaml';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import LocalityAreaExample from '!!raw-loader!@site/docs/_examples/admins/localityArea/area-admin-country-no-context.yaml';

# localityArea

Adds land or maritime area polygon to locality.

Property <code>localityId</code> points at [Locality](locality) feature that this area belongs to.

<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>localityArea</code></td>
</tr>
</table>

## Schema

<Tabs>
<TabItem value="browsable" label="Browsable" default>
<JSONSchemaViewer schema={ yamlLoad(LocalityAreaSchema) } resolverOptions={ generateResolverOptions({remote: true, yamlBasePath: '/admins'})}/>
</TabItem>
<TabItem value="yaml" label="YAML" default>
<CodeBlock language="jsx">{LocalityAreaSchema}</CodeBlock>
</TabItem>
</Tabs>

## Examples

<Tabs>
<TabItem value="localityArea" label="LocalityArea" default>
<CodeBlock language="json">{ JSON.stringify(yamlLoad(LocalityAreaExample), null, 2) }</CodeBlock>
</TabItem>
</Tabs>
10 changes: 5 additions & 5 deletions docusaurus/docs/themes/admins/admins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

Overture Administrative Boundary (Admins) data includes features that describe named localities in the real world including settlements, cities, regions, provinces, and countries.

The current version of the schema does not support the modeling of disputed boundaries or multiple geo-political views. In future schema versions, we will have support for:
The current version of the schema does not support the modeling of multiple geo-political views. In future schema versions, we will have support for:

1. Marking a boundary as disputed.
2. Providing multiple views of a country boundary based on the user's region.
3. Modeling the relationship between a country and its overseas territories or other disputed territories.
1. Providing multiple views of a country boundary based on the user's region.
2. Modeling the relationship between a country and its overseas territories or other disputed territories.

## Key Schema Design Choices

Expand All @@ -22,5 +21,6 @@ There are two sub-types:
- Administrative Localities model countries and their hierarchical subdivisions. Each Administrative Locality has an administrative level indicating its level within a country. Attributes like driving side and default language are also available.
- Named Localities model named places that are not part of a countries administrative hierarchy.

2. [Administrative Boundary](/reference/admins/administrativeBoundary) provides a boundary line of Administrative Localities. This feature allows for an easy display of country borders and
2. [LocalityArea](/reference/admins/localityArea) adds land or maritime polygon to [Locality](/reference/admins/locality).
3. [Administrative Boundary](/reference/admins/administrativeBoundary) provides a boundary line of Administrative Localities. This feature allows for an easy display of country borders and
administrative subdivisions within countries. Boundaries shared by different Administrative Localities are represented by one line. A maritime attribute supports filtering on boundaries located within seas or oceans.
1 change: 1 addition & 0 deletions docusaurus/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const sidebars = {
items: [
'reference/admins/administrativeBoundary',
'reference/admins/locality',
'reference/admins/localityArea',
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ properties:
updateTime: '2023-02-22T23:55:01-08:00'
version: 0
adminLevel: 2
maritime: true
isMaritime: true
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ properties:
updateTime: '2023-02-22T23:55:01-08:00'
version: 0
adminLevel: 2
maritime: true
isMaritime: true
geopolDisplay: disputed
14 changes: 3 additions & 11 deletions examples/admins/locality/admin-country-no-context.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
---
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
- -122.3183680
- 47.6238307
type: Point
properties:
theme: admins
type: locality
Expand Down
2 changes: 1 addition & 1 deletion examples/admins/locality/admin-named-locality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ geometry:
- 47.6238307
type: Point
properties:
context: seattleId
contextId: seattleId
localityType: neighborhood
names:
common:
Expand Down
48 changes: 0 additions & 48 deletions examples/admins/locality/geometry-multipolygon.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/admins/locality/geometry-point.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ properties:
version: 0
subType: administrativeLocality
adminLevel: 2
context: northAmericaId
contextId: northAmericaId
defaultLanguage: en
drivingSide: right
isoCountryCodeAlpha2: US
Expand Down
48 changes: 0 additions & 48 deletions examples/admins/locality/geometry-polygon.yaml

This file was deleted.

16 changes: 4 additions & 12 deletions examples/admins/locality/no-optional-properties.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
---
type: Feature
geometry:
type: Polygon
type: Point
coordinates:
- - - -61.8743292
- 48.8068635
- - -78.4016703
- 26.273714
- - -120.7749598
- 32.2499745
- - -126.928757
- 49.0378679
- - -61.8743292
- 48.8068635
- -61.8743292
- 48.8068635
properties:
theme: admins
type: locality
updateTime: '2023-02-22T23:55:01-08:00'
version: 0
subType: administrativeLocality
adminLevel: 2
context: northAmericaId
contextId: northAmericaId
localityType: country
names:
alternate:
Expand Down
21 changes: 21 additions & 0 deletions examples/admins/localityArea/area-admin-country-no-context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
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: localityArea
updateTime: '2023-02-22T23:55:01-08:00'
version: 0
localityId: unitedStates
4 changes: 1 addition & 3 deletions schema/admins/administrativeBoundary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ properties:
- "$ref": ../defs.yaml#/$defs/propertyContainers/overtureFeaturePropertiesContainer
properties:
adminLevel: { "$ref": "./defs.yaml#/$defs/propertyDefinitions/adminLevel" }
maritime:
description: Flag that specifies if the boundary is maritime (i.e., a boundary at a particular distance from a jurisdiction's coastline)
type: boolean
isMaritime: { "$ref": "./defs.yaml#/$defs/propertyDefinitions/isMaritime" }
geopolDisplay:
description: Optional value that indicates if the boundary needs special rendering logic
type: string
Expand Down
3 changes: 3 additions & 0 deletions schema/admins/defs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ description: Common schema definitions for admins theme
description: Left-hand traffic (LHT) or right-hand traffic (RHT).
type: string
enum: [left, right]
isMaritime:
description: Flag that specifies if feature is maritime (i.e., a boundary at a particular distance from a jurisdiction's coastline)
type: boolean
propertyContainers:
adminPropertiesContainer:
title: "Administrative Properties"
Expand Down
6 changes: 2 additions & 4 deletions schema/admins/locality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ properties:
unevaluatedProperties: false
oneOf:
- "$ref": https://geojson.org/schema/Point.json
- "$ref": https://geojson.org/schema/Polygon.json
- "$ref": https://geojson.org/schema/MultiPolygon.json
properties:
unevaluatedProperties: false
required: [subType, localityType, names]
Expand All @@ -26,7 +24,7 @@ properties:
- title: "Conditional Properties"
if: {properties: {adminLevel: { minimum: 3 }}}
then:
required: [context]
required: [contextId]
- "$ref": ../defs.yaml#/$defs/propertyContainers/overtureFeaturePropertiesContainer
properties:
subType:
Expand All @@ -35,6 +33,6 @@ properties:
enum: [administrativeLocality, namedLocality]
localityType: { "$ref": "./defs.yaml#/$defs/propertyDefinitions/localityType" }
names: { "$ref": "../defs.yaml#/$defs/propertyDefinitions/names" }
context:
contextId:
jwass marked this conversation as resolved.
Show resolved Hide resolved
description: Context entity is the most granular entity that logically contains given entity (but doesn't have to contain it spatially due to minor discrepancies in geometries)
type: string
Loading
Loading