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

Introduce building parts #51

Merged
merged 13 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 9 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
51 changes: 51 additions & 0 deletions docusaurus/docs/reference/buildings/part.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: part
---

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 BuildingPartSchema from "!!raw-loader!@site/docs/_schema/buildings/part.yaml";

import BuildingPartExample from "!!raw-loader!@site/docs/_examples/buildings/building-part-basic.yaml";

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Building Part

<table>
<tr>
<th>Geometry Type</th>
<td><code>Polygon</code> or <code>MultiPolygon</code></td>
</tr>
<tr>
<th>Theme</th>
<td><code>buildings</code></td>
</tr>
<tr>
<th>Type</th>
<td><code>part</code></td>
</tr>
</table>


## Schema

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

## Examples

<Tabs>
<TabItem value="1" label="Building Part" default>
<CodeBlock language="json">{ JSON.stringify(yamlLoad(BuildingPartExample), null, 2) }</CodeBlock>
</TabItem>
</Tabs>
1 change: 1 addition & 0 deletions docusaurus/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const sidebars = {
collapsed: false,
items: [
'reference/buildings/building',
'reference/buildings/part'
]
},
{
Expand Down
2 changes: 2 additions & 0 deletions docusaurus/src/YAML_FILE_TREE.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const _default = {
'/admins/locality.yaml': require('!!raw-loader!@site/docs/_schema/admins/locality.yaml'),

'/buildings/building.yaml': require('!!raw-loader!@site/docs/_schema/buildings/building.yaml'),
'/buildings/part.yaml': require('!!raw-loader!@site/docs/_schema/buildings/part.yaml'),
'/buildings/defs.yaml': require('!!raw-loader!@site/docs/_schema/buildings/defs.yaml'),

'/places/place.yaml': require('!!raw-loader!@site/docs/_schema/places/place.yaml'),

Expand Down
34 changes: 34 additions & 0 deletions examples/buildings/building-part-basic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
id: overture:buildings:part:1234
type: Feature
geometry:
type: Polygon
coordinates: [[
[-77.036873, 38.897804],
[-77.036873, 38.897559],
[-77.036260, 38.897559],
[-77.036260, 38.897804],
[-77.036873, 38.897804]
]]
properties:
# Custom user properties.
extFoo: I am a customer user property.
extBar: Me too!
# Overture properties
theme: buildings
type: part
version: 1
level: 1
updateTime: "2023-06-06T10:30:00-08:00"
building: abc123
height: 21.34
numFloors: 4
minHeight: 15.0
roofShape: dome
roofOrientation: across
roofDirection: 23.4
sources:
- property: ""
dataset: microsoftMLBuildings
- property: /properties/height
dataset: metaLidarExtractions
70 changes: 70 additions & 0 deletions examples/buildings/osm/outline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
https://www.openstreetmap.org/way/30407741

{
"id": "overture:buildings:building:1234",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-117.1710888,
32.7238481
],
[
-117.1711025,
32.7239038
],
[
-117.1711923,
32.7238882
],
[
-117.1712198,
32.7240000
],
[
-117.1712713,
32.7242091
],
[
-117.1706665,
32.7243145
],
[
-117.1705738,
32.7239379
],
[
-117.1707783,
32.7239022
],
[
-117.1710888,
32.7238481
]
]
]
},
"properties": {
"extFoo": "I am a customer user property.",
"extBar": "Me too!",
"theme": "buildings",
"type": "building",
"version": 1,
"level": 1,
"updateTime": "2023-06-06T10:30:00-08:00",
"names": {
"common": [{
"value": "Valentina by Alta",
"language": "local"
}]
},
"numFloors": 8,
"class": "commercial",
"sources": [{
"property": "",
"dataset": "OpenStreetMap"
}]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add hasParts set to True

}
}
70 changes: 70 additions & 0 deletions examples/buildings/osm/part1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"id": "overture:buildings:part:100",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-117.1707971,
32.7240658
],
[
-117.1712198,
32.7240000
],
[
-117.1712713,
32.7242091
],
[
-117.1706665,
32.7243145
],
[
-117.1705738,
32.7239379
],
[
-117.1707783,
32.7239022
],
[
-117.1707949,
32.7240226
],
[
-117.1707279,
32.7240319
],
[
-117.1707635,
32.7241786
],
[
-117.1708208,
32.7241677
],
[
-117.1707971,
32.7240658
]
]
]
},
"properties": {
"building": "1234",
"extFoo": "I am a customer user property.",
"extBar": "Me too!",
"theme": "buildings",
"type": "part",
"version": 1,
"level": 1,
"updateTime": "2023-06-06T10:30:00-08:00",
"numFloors": 8,
"sources": [{
"property": "",
"dataset": "OpenStreetMap"
}]
}
}
70 changes: 70 additions & 0 deletions examples/buildings/osm/part2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"id": "overture:buildings:part:101",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-117.1712198,
32.7240000
],
[
-117.1711923,
32.7238882
],
[
-117.1711025,
32.7239038
],
[
-117.1710888,
32.7238481
],
[
-117.1707783,
32.7239022
],
[
-117.1707949,
32.7240226
],
[
-117.1707279,
32.7240319
],
[
-117.1707635,
32.7241786
],
[
-117.1708208,
32.7241677
],
[
-117.1707971,
32.7240658
],
[
-117.1712198,
32.7240000
]
]
]
},
"properties": {
"building": "1234",
"extFoo": "I am a customer user property.",
"extBar": "Me too!",
"theme": "buildings",
"type": "part",
"version": 1,
"level": 1,
"updateTime": "2023-06-06T10:30:00-08:00",
"numFloors": 3,
"sources": [{
"property": "",
"dataset": "OpenStreetMap"
}]
}
}
12 changes: 4 additions & 8 deletions schema/buildings/building.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@ properties:
properties:
unevaluatedProperties: false
allOf:
- "$ref": ./defs.yaml#/shapeContainer
- "$ref": ../defs.yaml#/$defs/propertyContainers/overtureFeaturePropertiesContainer
- "$ref": ../defs.yaml#/$defs/propertyContainers/levelContainer
properties:
names: { "$ref": "../defs.yaml#/$defs/propertyDefinitions/names" }
height:
description: Height of the building in meters
type: number
exclusiveMinimum: 0
numFloors:
description: Number of above-ground floors of the building
type: integer
exclusiveMinimum: 0
class:
description: >-
A broad category of the building type / purpose. When the current use of the building does not match the built purpose, the class should
Expand All @@ -48,3 +41,6 @@ properties:
- medical
- entertainment
- military
hasParts:
description: Flag indicating whether the building has parts
type: boolean
Loading
Loading