Skip to content

Commit

Permalink
Merge pull request #51 from OvertureMaps/building_parts
Browse files Browse the repository at this point in the history
Introduce building parts
  • Loading branch information
RobSoetewey-TomTom authored Nov 16, 2023
2 parents f4582d6 + c581984 commit 192f07a
Show file tree
Hide file tree
Showing 12 changed files with 315 additions and 8 deletions.
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 @@ -77,6 +77,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"
buildingId: 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
33 changes: 33 additions & 0 deletions examples/buildings/osm/outline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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.724],
[-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
30 changes: 30 additions & 0 deletions examples/buildings/osm/part1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
id: overture:buildings:part:100
type: Feature
geometry:
type: Polygon
coordinates: [[
[-117.1707971, 32.7240658],
[-117.1712198, 32.724],
[-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:
buildingId: '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
30 changes: 30 additions & 0 deletions examples/buildings/osm/part2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
id: overture:buildings:part:101
type: Feature
geometry:
type: Polygon
coordinates: [[
[-117.1712198, 32.724],
[-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.724]
]]
properties:
buildingId: '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 @@ -19,18 +19,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 @@ -50,3 +43,6 @@ properties:
- medical
- entertainment
- military
hasParts:
description: Flag indicating whether the building has parts
type: boolean
95 changes: 95 additions & 0 deletions schema/buildings/defs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
"$schema": https://json-schema.org/draft/2020-12/schema
title: Overture Maps Shared Building Properties
description: Common schema definitions shared by building footprints and building parts
shapeContainer:
title: Shape
description: Properties of the buildings shape, such as height or roof type.
properties:
height:
description: >-
Height of the building or part in meters. The height is the distance from the lowest point to the highest point.
type: number
exclusiveMinimum: 0
numFloors:
description: >-
Number of above-ground floors of the building or part.
type: integer
exclusiveMinimum: 0
minHeight:
description: >-
The height of the bottom part of building in meters. Used if a building or part of building starts above the ground level.
type: number
facadeColor:
description: >-
The color (name or color triplet) of the facade of a building or building part in hexadecimal
type: string
facadeMaterial:
description: >-
The outer surface material of building facade.
type: string
enum:
- brick
- cement_block
- concrete
- glass
- metal
- mud
- plaster
- plastic
- stone
- wood
- other
roofMaterial:
description: >-
The outermost material of the roof.
type: string
enum:
- concrete
- copper
- eternit
- glass
- grass
- metal
- plastic
- roof_tiles
- slate
- tar_paper
- thatch
- wood
- other
roofShape:
description: The shape of the roof
type: string
enum:
- dome
- flat
- gable
- gambrel
- half-hip
- hip
- mansard
- onion
- pyramid
- round
- spherical
- other
roofDirection:
description: >-
Bearing of the roof ridge line.
type: number
exclusiveMinimum: 0
exclusiveMaximum: 360
roofOrientation:
description: >-
Orientation of the roof shape relative to the footprint shape. Either "along" or "across".
type: string
enum:
- across
- along
roofColor:
description: The color (name or color triplet) of the roof of a building or building part in hexadecimal
type: string
eaveHeight:
description: The height of the building eave in meters
type: number
26 changes: 26 additions & 0 deletions schema/buildings/part.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
"$schema": https://json-schema.org/draft/2020-12/schema
title: Building Part Schema
description: >-
A single building part. Parts describe their shape and color and other properties. Each
building part must contain the building with which it is associated.
type: object
properties:
geometry:
description: >-
The part's geometry. It must be a polygon or multipolygon.
unevaluatedProperties: false
oneOf:
- "$ref": https://geojson.org/schema/Polygon.json
- "$ref": https://geojson.org/schema/MultiPolygon.json
properties:
unevaluatedProperties: false
allOf:
- "$ref": ./defs.yaml#/shapeContainer
- "$ref": ../defs.yaml#/$defs/propertyContainers/overtureFeaturePropertiesContainer
- "$ref": ../defs.yaml#/$defs/propertyContainers/levelContainer
required: [buildingId]
properties:
buildingId:
description: The building ID to which this part belongs
type: string
1 change: 1 addition & 0 deletions schema/defs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ description: Common schema definitions shared by all themes
- land
- landUse
- locality
- part
- place
- segment
- water
Expand Down
8 changes: 8 additions & 0 deletions schema/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ oneOf:
type: { enum: [building] }
then: { "$ref": buildings/building.yaml }
else: { propertyNames: false }
- if:
properties:
properties:
properties:
theme: { enum: [buildings] }
type: { enum: [part] }
then: { "$ref": buildings/part.yaml }
else: { propertyNames: false }
- if:
properties:
properties:
Expand Down

0 comments on commit 192f07a

Please sign in to comment.