Skip to content

Commit

Permalink
Segment restructure (#203)
Browse files Browse the repository at this point in the history
* Flatten road wip

* Flatten road wip

* Fixes and update examples

* Fix and add descriptions

* Update docs, add deprecation comments

* Fix bad merge, separate segment and conditional road properties

---------

Co-authored-by: Brad Richardson <[email protected]>
  • Loading branch information
brad-richardson and brad-richardson authored May 30, 2024
1 parent 56cbb96 commit ff1d5b3
Show file tree
Hide file tree
Showing 70 changed files with 1,152 additions and 294 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"update_time": "2024-03-14T08:05:36-08:00",
"subtype": "road",
"class": "primary",
"road_flags": [
{
"values": ["is_tunnel", "is_tunnel"]
}
],
"road": {
"flags": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"update_time": "2024-03-14T08:08:07-08:00",
"subtype": "road",
"class": "primary",
"road_flags": [
{
"values": ["foo"]
}
],
"road": {
"flags": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"update_time": "2024-03-14T08:08:17-08:00",
"subtype": "road",
"class": "primary",
"road_flags": [
{
"values": ["is_private"]
}
],
"road": {
"flags": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
},
"properties": {
"ext_expected_errors": [
"[I#/properties/road/flags/0] [S#/$defs/propertyDefinitions/road/properties/flags/items/type] expected object, but got string"
"[I#/properties/road/flags/0] [S#/$defs/propertyDefinitions/road/properties/flags/items/type] expected object, but got string",
"[I#/properties/road_flags/0] [S#/$defs/propertyDefinitions/road/road_flags/items/type] expected object, but got string"
],
"theme": "transportation",
"type": "segment",
"version": 20,
"update_time": "2024-03-14T08:08:27-08:00",
"subtype": "road",
"class": "primary",
"road_flags": ["is_tunnel"],
"road": {
"flags": ["is_tunnel"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
"update_time": "2024-03-14T08:08:38-08:00",
"subtype": "road",
"class": "primary",
"road_flags": [
{
"values": ["is_tunnel"]
}
],
"lanes": [
{
"value": [
{
"direction": "backward",
"restrictions": {
"min_occupancy": 0
}
}
]
}
],
"road": {
"flags": [
{
Expand All @@ -30,7 +47,6 @@
]
}
]

},
"ext_expected_errors": [
"[I#/properties/road/lanes/0/value/0/restrictions/min_occupancy] [S#/$defs/propertyDefinitions/lane/properties/restrictions/properties/min_occupancy/minimum] must be >= 1 but found 0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,27 @@
"update_time": "2024-03-14T08:08:37-08:00",
"subtype": "road",
"class": "primary",
"road_flags": [
{
"values": ["is_tunnel"]
}
],
"lanes": [
{
"value": [
{
"direction": "forward",
"restrictions": {
"min_occupancy": [
{
"is_at_least": 3
}
]
}
}
]
}
],
"road": {
"flags": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
"update_time": "2024-03-14T08:08:39-08:00",
"subtype": "road",
"class": "primary",
"road_flags": [
{
"values": ["is_bridge"]
}
],
"when": {
"during": "Mo-Sa 09:00-12:00, We 15:00-18:00"
},
"road": {
"flags": [
{
Expand All @@ -23,7 +31,8 @@
}
},
"ext_expected_errors": [
"[I#/properties/road/when] [S#/$defs/propertyDefinitions/road/unevaluatedProperties] not allowed"
"[I#/properties/road/when] [S#/$defs/propertyDefinitions/road/unevaluatedProperties] not allowed",
"[I#/properties/when] [S#/$defs/propertyDefinitions/unevaluatedProperties] not allowed"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ properties:
subtype: road
class: secondary
connector_ids: [fooConnector, barConnector]
road:
level_rules:
- value: 1.5
road: # The `road` property is deprecated and will be removed in the 2024-07 release
level:
- value: 1.5
ext_expected_errors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ properties:
subtype: road
class: secondary
connector_ids: [fooConnector, barConnector]
road:
level_rules:
- value: 1
foo: bar
road: # The `road` property is deprecated and will be removed in the 2024-07 release
level:
- value: 1
foo: bar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"update_time": "2024-03-14T08:08:49-08:00",
"subtype": "road",
"class": "primary",
"road_surface": [
{
"value": "hot mess"
}
],
"road": {
"surface": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ properties:
subtype: road
class: secondary
connector_ids: [fooConnector, barConnector]
road:
road_surface: gravel
road_flags:
- [is_link, is_tunnel]
access_restrictions:
- access_type: allowed
when: {mode: [foo]}
road: # The `road` property is deprecated and will be removed in the 2024-07 release
surface: gravel
flags:
flags:
- [is_link, is_tunnel]
restrictions:
access:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ properties:
subtype: road
class: secondary
connector_ids: [fooConnector, barConnector]
road:
access_restrictions:
- access_type: allowed
when: {vehicle: {axle_count: {is_foo: 5}}}
road: # The `road` property is deprecated and will be removed in the 2024-07 release
restrictions:
access:
- access_type: allowed
when: {vehicle: {axle_count: {is_foo: 5}}}
ext_expected_errors:
- "[I#/properties/road/restrictions/access/0/when/vehicle/axle_count] [S#/$defs/propertyDefinitions/integerRelation/oneOf] oneOf failed"
- "[I#/properties/road/restrictions/access/0/when/vehicle/axle_count/is_foo] [S#/$defs/propertyDefinitions/integerRelation/unevaluatedProperties] not allowed"
- "[I#/properties/road/access_restrictions/0/when/vehicle/axle_count] [S#/$defs/propertyDefinitions/integerRelation/oneOf] oneOf failed"
- "[I#/properties/road/access_restrictions/0/when/vehicle/axle_count/is_foo] [S#/$defs/propertyDefinitions/integerRelation/unevaluatedProperties] not allowed"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ properties:
class: tertiary
version: 1
update_time: "2024-03-14T08:10:55-08:00"
road:
access_restrictions:
- foo: bar
- access_type: denied
when:
baz: qux
road: # The `road` property is deprecated and will be removed in the 2024-07 release
restrictions:
access:
- foo: bar
Expand All @@ -21,3 +26,6 @@ properties:
- "[I#/properties/road/restrictions/access/0] [S#/$defs/propertyContainers/accessContainer/items/required] missing properties: 'access_type'"
- "[I#/properties/road/restrictions/access/0/foo] [S#/$defs/propertyContainers/accessContainer/items/unevaluatedProperties] not allowed"
- "[I#/properties/road/restrictions/access/1/when/baz] [S#/$defs/propertyContainers/accessContainer/items/properties/when/unevaluatedProperties] not allowed"
- "[I#/properties/access/0] [S#/$defs/propertyContainers/accessContainer/items/required] missing properties: 'access_type'"
- "[I#/properties/access/0/foo] [S#/$defs/propertyContainers/accessContainer/items/unevaluatedProperties] not allowed"
- "[I#/properties/access/1/when/baz] [S#/$defs/propertyContainers/accessContainer/items/properties/when/unevaluatedProperties] not allowed"
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ properties:
class: primary
connector_ids:
- overture:transportation:example:connector:1
road:
prohibited_transitions:
- sequence:
- segment_id: foo
connector_id: bar
- segment_id: foo
connector_id: bar
final_heading: forward
road: # The `road` property is deprecated and will be removed in the 2024-07 release
restrictions:
prohibited_transitions:
- sequence:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ properties:
class: primary
connector_ids:
- overture:transportation:example:connector:1
road:
prohibited_transitions:
- sequence: []
final_heading: forward
road: # The `road` property is deprecated and will be removed in the 2024-07 release
restrictions:
prohibited_transitions:
- sequence: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ properties:
class: primary
connector_ids:
- overture:transportation:example:connector:1
road:
prohibited_transitions:
- sequence:
- segment_id: foo
connector_id: bar
road: # The `road` property is deprecated and will be removed in the 2024-07 release
restrictions:
prohibited_transitions:
- sequence:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ properties:
class: residential
version: 1
update_time: "2024-03-14T08:12:00-08:00"
road:
prohibited_transitions:
- sequence:
- connector_id: connector1
segment_id: segment1
final_heading: backward
foo: bar
when:
baz: qux
road: # The `road` property is deprecated and will be removed in the 2024-07 release
restrictions:
prohibited_transitions:
- sequence:
Expand All @@ -23,3 +31,5 @@ properties:
ext_expected_errors:
- "[I#/properties/road/restrictions/prohibited_transitions/0/foo] [S#/$defs/propertyDefinitions/road/properties/restrictions/properties/prohibited_transitions/items/unevaluatedProperties] not allowed"
- "[I#/properties/road/restrictions/prohibited_transitions/0/when/baz] [S#/$defs/propertyDefinitions/road/properties/restrictions/properties/prohibited_transitions/items/properties/when/unevaluatedProperties] not allowed"
- "[I#/properties/prohibited_transitions/0/foo] [S#/$defs/propertyDefinitions/restrictions/properties/prohibited_transitions/items/unevaluatedProperties] not allowed"
- "[I#/properties/prohibited_transitions/0/when/baz] [S#/$defs/propertyDefinitions/restrictions/properties/prohibited_transitions/items/properties/when/unevaluatedProperties] not allowed"
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"update_time": "2024-03-14T08:25:53-08:00",
"subtype": "road",
"class": "primary",
"speed_limits": [
{}
],
"road": {
"restrictions": {
"speed_limits": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"update_time": "2024-03-14T08:14:05-08:00",
"subtype": "road",
"class": "primary",
"speed_limits": {},
"road": {
"restrictions": {
"speed_limits": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ properties:
ext_baz: I am a custom user property...
ext_expected_errors:
- "[I#/properties/road/restrictions/speed_limits/0/when/mode/0] [S#/$defs/propertyDefinitions/travelMode/enum] value must be one of"
- "[I#/properties/speed_limits/0/when/mode/0] [S#/$defs/propertyDefinitions/travelMode/enum] value must be one of"
# Overture properties
theme: transportation
type: segment
Expand All @@ -17,7 +18,12 @@ properties:
subtype: road
class: secondary
connector_ids: [fooConnector, barConnector]
road:
speed_limits:
- max_speed:
value: 110
unit: mph
when: {mode: [foo]}
road: # The `road` property is deprecated and will be removed in the 2024-07 release
restrictions:
speed_limits:
- max_speed:
Expand Down
15 changes: 2 additions & 13 deletions docusaurus/docs/schema/attributes/scoping-rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,13 @@ to privately-authorized individuals, such as condo unit owners:

#### Vehicle attributes scoping

<!--
TODO: Once https://github.com/OvertureMaps/schema-wg/issues/147 is
fixed, remove the commenting around the tabs to enable the
example, and remove the comments around the access restrictions
in the example.

<Tabs>
<TabItem value="description" label="Description" default>

-->

Vehicle attribute scoping limits the scope of a parent value to apply
only when the vehicle in use meets certain criteria.

The property construct `when: { vehicle: { ... } }` applies vehicle
The property construct `when: { vehicle: [{ dimension: ..., comparison: ..., value: ... }] }` applies vehicle
attributes scoping to a parent value.

Note that vehicle attribute scoping can overlap to some degree with
Expand All @@ -284,7 +276,6 @@ rules may be scoped to the travel mode "heavy goods vehicle", while
another equivalent access rule could be scoped to the vehicle attribute
"gross vehicle weight".

<!--
</TabItem>
<TabItem value="example" label="Example" default>

Expand All @@ -293,8 +284,6 @@ another equivalent access rule could be scoped to the vehicle attribute
</TabItem>
</Tabs>

-->


<!--

Expand Down Expand Up @@ -384,7 +373,7 @@ properties:
version: 0
update_time: "2023-06-16T15:57:00-06:00"
subtype: road
road:
road: # The `road` property is deprecated and will be removed in the 2024-07 release
lanes:
- value:
- direction: forward
Expand Down
Loading

0 comments on commit ff1d5b3

Please sign in to comment.