Project Card Data Model ¶
Warning
These models are not the canonical schema and may or may not be completely accurate and up to date – although we try our best. The canonical schema is maintained in json-schema format and is documented on the schemas page – but this is much nicer to read so we recommend you stay here.
ProjectCard Data Model.
ProjectCards are a set of information that describe an infrastructure project or change to a network. They are used to document and manage changes to a network such as adding a new bus route, changing a roadway property, changing the number of lanes on a roadway, or increasing transit service frequency.
ProjectCards are composed of one or more changes. Each change is a specific type of change that happens to a specific portion, or selection of the network, such as a roadway property change, transit property change, or transit route addition. Each change type has its own set of parameters that describe the change in detail.
Grouping Related Changes: ¶
When more than one change is needed to describe a project, the changes
field can be used to
specify a list of changes. This is useful when a project requires multiple changes to be made
to the network. For example, a project to add a new bus route may require adding new bus lanes
to the roadway network. Or adding a new, mid-block bus-route may require adding a new bus stop
as a node in the roadway network and splitting the link.
While the user can choose what changes should be grouped together into a single, “project”, they should be careful to ensure that the changes are logically related and would likely be implemented together.
Phased Projects: ¶
In cases where a project maybe implemented in multiple phases, it is recommended to create separate project cards for each phase. This will help to ensure that the project can be in a network similar to how it would be implemented in the real world.
Dependencies: ¶
If a project requires another project to be implemented first, the pre-requisites
field
of dependencies
can be used. Similarly, if a project would be impossible to implement
if another project is implemented, the conflicts
field of dependencies
can be used.
corequisites
can be used to specify projects that must be implemented at the same time -
noting that if Project A specifies Project B as a corequisite, then Project B need not specify
Project A as a corequisite (if they were dependent upon each other, then they should likely
be combined into a single project).
Tags: ¶
Tags can be used to categorize projects and make it easier to search for projects that are
related to a specific topic or type of project. For example, a collection of projects that are
considered to be in your committed future baseline because they have committed funding could
be tagged as committed
.
Formats + Serialization: ¶
ProjectCards can be represented within memory as any structured data format such as JSON, Python Dictionaries, or a Struct. They can also be serialized to any nested file format that is compatible with JSON-schema such as YAML, TOML, or JSON. For the purposes of this documentation, we will use YAML as the serialization format for the examples becuase it is less verbose than JSON and python dictonaries and easier to read.
List of tools that support json-schema: https://json-schema.org/tools
Attributes:
Name | Type | Description |
---|---|---|
project |
str
|
The name of the project. This name must be unique within a set of projects being managed or applied to a network. |
notes |
Optional[str]
|
Additional freeform notes about the project. |
tags |
Optional[list[str]]
|
Tags for the project to associate the project card with a specific project or type of project. |
dependencies |
Optional[Dependencies]
|
Dependencies for the project card: conflicts, prerequisites, and corequisites…each of which is a list of project names. |
changes |
Optional[list[ChangeTypes]]
|
List of one or more changes. Must either have
|
roadway_property_change |
Optional[RoadwayPropertyChanges]
|
A single roadway property
change. Cannot be used with |
roadway_deletion |
Optional[RoadwayDeletion]
|
A single roadway deletion change. Cannot
be used with |
roadway_addition |
Optional[RoadwayAddition]
|
A single roadway addition change. Cannot
be used with |
transit_property_change |
Optional[TransitPropertyChange]
|
A single Transit property
change. Cannot be used with |
transit_routing_change |
Optional[TransitRoutingChange]
|
A single Transit routing change.
Cannot be used with |
transit_service_deletion |
Optional[TransitServiceDeletion]
|
A single Transit service
deletion change. Cannot be used with |
transit_route_addition |
Optional[TransitRouteAddition]
|
A single transit route addition
change. Cannot be used with |
pycode |
Optional[str]
|
A single pycode type change which uses python code for the project
which refers to self as a transit or roadway network. Cannot be used with |
self_obj_type |
Optional[Literal['RoadwayNetwork', 'TransitNetwork']]
|
Type of object
being changed in the pycode python code. Must be either TransitNetwork or
RoadwayNetwork. Cannot be used with |
Example Project Card
Source code in projectcard/models/project.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
Change Types ¶
Change type models for project card.
ChangeTypes
¶
Union of all change types.
Source code in projectcard/models/changes.py
RoadwayAddition
¶
Requirements for describing roadway addition project card.
Attributes:
Name | Type | Description |
---|---|---|
links |
Optional[list[RoadLink]]
|
Roadway links to add. Must have at least one link. |
nodes |
Optional[list[RoadNode]]
|
Roadway nodes to add. Must have at least one node. |
Example Roadway Addition
roadway_addition:
links:
- A: 269066
B: 268932
name: new neighborhood st
roadway: residential
lanes: 1
model_link_id: 404982
- A: 268932
B: 269066
name: new neighborhood st
roadway: residential
lanes: 1
model_link_id: 407042
nodes:
- model_node_id: 268932
latitude: 37.7749
longitude: -122.4194
- model_node_id: 269066
latitude: 37.7749
longitude: -122.4194
Source code in projectcard/models/changes.py
RoadwayDeletion
¶
Requirements for describing roadway deletion project card (e.g. to delete).
Attributes:
Name | Type | Description |
---|---|---|
links |
Optional[SelectRoadLinks]
|
Roadway links to delete. |
nodes |
Optional[SelectRoadNodes]
|
Roadway nodes to delete. |
clean_shapes |
bool
|
If True, will clean unused roadway shapes associated with the deleted links if they are not otherwise being used. Defaults to False. |
clean_nodes |
bool
|
If True, will clean unused roadway nodes associated with the deleted links if they are not otherwise being used. Defaults to False. |
Example Roadway Deletion
Source code in projectcard/models/changes.py
RoadwayPropertyChanges
¶
Value for setting property changes for a time of day and category.
Attributes:
Name | Type | Description |
---|---|---|
facility |
SelectFacility
|
Selection of roadway links to change properties for. |
property_changes |
dict[str, RoadwayPropertyChange]
|
Property changes to apply to the selection. Must have at least one property change. |
Example Roadway Property Change
Source code in projectcard/models/changes.py
TransitPropertyChange
¶
Value for setting property change for a time of day and category.
Attributes:
Name | Type | Description |
---|---|---|
service |
SelectTransitTrips
|
Selection of transit trips to change properties for. |
property_changes |
dict[str, TransitPropertyChange]
|
List of property changes to apply. |
Example Transit Property Change
Source code in projectcard/models/changes.py
TransitRouteAddition
¶
Requirements for describing transit route addition project card.
Attributes:
Name | Type | Description |
---|---|---|
routes |
list[TransitRoute]
|
List of transit routes to be added. Must have at least one route. |
Example Transit Route Addition
transit_route_addition:
routes:
- route_id: abc
route_long_name: green_line
route_short_name: green
route_type: 3
agency_id: The Bus
trips:
- direction_id: 0
headway_secs:
- ('6:00','12:00'): 600
- ('12:00','13:00'): 900
routing:
- 1:
stop: true #when stop is set to True, defaults to allow both boarding and alighting
- 2
- 3
- 4:
stop: true # default to False, specify only when stopping
alight: false # default to True, specify only when not default
- 5
- 6:
stop: true
Source code in projectcard/models/changes.py
TransitRoutingChange
¶
Value for setting routing change for transit.
Attributes:
Name | Type | Description |
---|---|---|
service |
SelectTransitTrips
|
Selection of transit trips to change routing for. |
transit_routing_change |
TransitRoutingChange
|
Existing and changed routing as denoted as a list of nodes with nodes where the route doesn’t stop noted as negative integers. |
Example Transit Routing Change
Source code in projectcard/models/changes.py
TransitServiceDeletion
¶
Requirements for describing transit service deletion project card (e.g. to delete).
Attributes:
Name | Type | Description |
---|---|---|
service |
SelectTransitTrips
|
Selection of transit trips to delete. |
clean_shapes |
Optional[bool]
|
If True, will clean unused transit shapes associated with the deleted trips if they are not otherwise being used. Defaults to False. |
clean_routes |
Optional[bool]
|
If True, will clean unused routes associated with the deleted trips if they are not otherwise being used. Defaults to False. |
Example Transit Service Deletion
Source code in projectcard/models/changes.py
Selections ¶
Data models for selecting nodes, links, and trips in a project card.
SelectFacility
¶
Roadway Facility Selection.
Each selection must have at either: links
, nodes
, or links
and from
and to
.
Specifying links
, from
, and to
will attempt to select a continuous path between the
two nodes which as much as possible follows the initial link selection that is provided
(e.g. name
, osm_link_id
, model_link_id
, ref
) using the specified modes
.
Secondary selection parameters (e.g. lanes
, price
) will be used to filter the
continuous path - reulting in a final selection of links that may or may not connect
the two nodes.
Attributes:
Name | Type | Description |
---|---|---|
links |
Optional[SelectRoadLinks]
|
Selection of roadway links. |
nodes |
Optional[SelectRoadNodes]
|
Selection of roadway nodes. |
from |
Optional[SelectRoadNode]
|
Selection of the origin node. |
to |
Optional[SelectRoadNode]
|
Selection of the destination node. |
Example: Select all links between osm nodes 1 and 2 along main
.
Example: Select links between model nodes 4 and 5 along I-95 that are 3 lanes.
Example: Select all links on SR320 which have 1 or 2 managed lanes.
Source code in projectcard/models/selections.py
SelectRoadLinks
¶
Requirements for describing links in the facility
section of a project card.
Must have one of all
, name
, osm_link_id
, or model_link_id
.
Additional fields to select on may be provided and will be treated as an AND condition after
the primary selection from all
, name
, osm_link_id
, or model_link_id
.
Attributes:
Name | Type | Description |
---|---|---|
all |
bool
|
If True, select all links. |
name |
Optional[list[str]]
|
List of names to select. If multiple provided will be treated as an OR condition. |
ref |
Optional[list[str]]
|
Open Street Map |
osm_link_id |
Optional[list[str]]
|
List of OSM link IDs to select. If multiple provided will be treated as an OR condition. |
model_link_id |
Optional[list[int]]
|
List of model link IDs to select. If multiple provided will be treated as an OR condition. |
modes |
Optional[Modes]
|
List of modes to select. If multiple provided will be treated as an OR condition. |
ignore_missing |
bool
|
If True, ignore missing links. Otherwise, raise an error if they are not found. Defaults to True. |
Example: 2 and 3 lane drivable links named ‘Main St’ or ‘Broadway’.
Example: Links where biking is allowed but driving is not.
Source code in projectcard/models/selections.py
SelectRoadNodes
¶
Requirements for describing multiple nodes of a project card (e.g. to delete).
Attributes:
Name | Type | Description |
---|---|---|
all |
bool
|
If True, select all nodes. Must have either |
osm_node_id |
Optional[list[str]]
|
List of OSM node IDs to select. Must have either
|
model_node_id |
Optional[list[int]]
|
List of model node IDs to select. Must have either
|
ignore_missing |
bool
|
If True, ignore missing nodes. Otherwise, raise an error if they are not found. Defaults to True. |
Source code in projectcard/models/selections.py
SelectTransitTrips
¶
Selection of transit trips.
Each selection must have at least one of trip_properties
, route_properties
, nodes
,
or links
.
Multiple requirements are treated as an AND condition.
Attributes:
Name | Type | Description |
---|---|---|
trip_properties |
Optional[SelectTripProperties]
|
Selection based on trip properties. |
route_properties |
Optional[SelectRouteProperties]
|
Selection based on route properties. |
timespans |
List[Timespan]
|
List of timespans to select. Multiple timespans are treated as an OR condition. |
nodes |
Optional[SelectTransitNodes]
|
Transit nodes to select. Useful for querying stops that might be moved/deleted when a roadway is changed. |
links |
Optional[SelectTransitLinks]
|
Selection of transit links. Useful for querying links that might be moved/deleted when a roadway is changed. |
Example: Select trips on route 1 or 2 that run between 12:00 and 19:45.
Example: Select express route trips that goes through nodes 1, 2, and 3.
Source code in projectcard/models/selections.py
Supporting Models ¶
Structures (lists and objects) used in project card models.
Dependencies
¶
Dependencies for a project card.
Source code in projectcard/models/structs.py
IndivScopedPropertySetItem
¶
Value for setting property value for a single time of day and category.
Must have at least one of set
or change
.
Attributes:
Name | Type | Description |
---|---|---|
category |
Optional[Union[str, int]]
|
Optional[Union[str, int]]: Category for the property change. If not provided, the change will be applied to all categories minus any other categories that are provided. |
timespan |
Optional[Timespan]
|
Optional[Timespan]: Timespan for the property change. If not provided, the change will be applied to the entire timespan minus any other timespans that are provided. |
set |
Optional[Any]
|
Optional[Any]: Value to set for the property change. |
existing |
Optional[Any]
|
Optional[Any]: Existing value for the property change. |
change |
Optional[Union[int, float]]
|
Optional[Union[int, float]]: Change value for the property change. |
Example Scoped Property Set
Source code in projectcard/models/structs.py
RoadLink
¶
Requirements for describing new roadway links of a project card.
The following fields may NOT be specified in a ProjectCard as they are calculated or managed
by Wrangler: model_link_id_idx
, managed
, geometry
, projects
, ML_geometry
, ML_A
,
ML_B
, ML_projects
.
Attributes:
Name | Type | Description |
---|---|---|
model_link_id |
int
|
|
A |
int
|
|
B |
int
|
|
name |
str
|
|
roadway |
OsmRoadwayType
|
|
lanes |
Annotated[int, Field(ge=0)]
|
|
price |
Optional[float]
|
Optional[float]: Price for the link. |
rail_only |
Optional[bool]
|
Optional[bool]: True if the link is rail only. |
bus_only |
Optional[bool]
|
Optional[bool]: True if the link is bus only. |
drive_access |
Optional[bool]
|
Optional[bool]: True if the link is drive accessible. |
bike_access |
Optional[bool]
|
Optional[bool]: True if the link is bike accessible. |
walk_access |
Optional[bool]
|
Optional[bool]: True if the link is walk accessible. |
truck_access |
Optional[bool]
|
Optional[bool]: True if the link is truck accessible. |
distance |
Annotated[float, Field(ge=0)]
|
|
shape_id |
Optional[str]
|
Optional[str]: Shape ID for the link used as a foreign key to a roadway shape table. |
osm_link_id |
Optional[str]
|
Optional[str]: OSM link ID. |
access |
Optional[Any]
|
Optional[Any]: Access for the link. |
sc_lanes |
Optional[list[dict]]
|
Optional[list[dict]]: List of values of the lane property as it changes with timespans and/or categories (e.g. HOV, truck, etc.). |
sc_price |
Optional[list[dict]]
|
Optional[list[dict]]: List of values of the price property as it changes with timespans and/or categories (e.g. HOV, truck, etc.). |
ML_access_point |
Optional[MLAccessEgress]
|
Optional[MLAccessEgress]: Access point for parallel managed lanes. |
ML_egress_point |
Optional[MLAccessEgress]
|
Optional[MLAccessEgress]: Egress point for parallel managed lanes. |
ML_lanes |
Optional[Annotated[int, Field(0, ge=0)]]
|
Optional[int]: Number of lanes for parallel managed lanes. Must be greater than or equal to 0. |
ML_price |
Optional[Annotated[float, Field(0)]]
|
Optional[float]: Price for parallel managed lanes. |
ML_access |
Optional[Any]
|
Optional[Any]: Access for parallel managed lanes. |
sc_ML_lanes |
Optional[list[dict]]
|
Optional[list[dict]]: List of values of the lane property for parallel managed lanes as it changes with timespans and/or categories (e.g. HOV, truck, etc.). |
sc_ML_price |
Optional[list[dict]]
|
Optional[list[dict]]: List of values of the price property for parallel managed lanes as it changes with timespans and/or categories (e.g. HOV, truck, etc.). |
Example Roadway Link
- model_link_id: 404982
A: 269066
B: 268932
name: new freeway
roadway: motorway
lanes: 3
distance: 0.5
sc_lanes:
- timespan: ['6:00', '9:00']
value: 2
- timespan: ['9:00', '15:00']
value: 4
sc_price:
- timespan: ['6:00', '9:00']
value: 2.0
- timespan: ['9:00', '15:00']
value: 4.0
ML_access_point: 'all'
ML_egress_point: 'all'
ML_lanes: 1
sc_ML_lanes:
- timespan: ['6:00', '9:00']
value: 2
- timespan: ['9:00', '15:00']
value: 4
sc_ML_price:
- timespan: ['6:00', '9:00']
value: 2.0
- timespan: ['9:00', '15:00']
value: 4.0
Source code in projectcard/models/structs.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
|
check_protected_omitted(data)
classmethod
¶
Check that protected fields are omitted.
Source code in projectcard/models/structs.py
RoadNode
¶
Requirements for describing new roadway nodes of a project card.
Attributes:
Name | Type | Description |
---|---|---|
model_node_id |
int
|
|
X |
Longitude
|
|
Y |
Latitude
|
|
Source code in projectcard/models/structs.py
RoadwayPropertyChange
¶
Value for setting a single property value.
Must have at least one of set
or change
.
Attributes:
Name | Type | Description |
---|---|---|
existing |
Optional[Any]
|
Optional[Any]: Existing value for the property change. Assumption about the existing (default, not scoped) value for this property. |
change |
Optional[Union[int, float]]
|
Optional[Union[int, float]]: Change value for the property change. If |
set |
Optional[Any]
|
Optional[Any]: Value to set the property to. If |
scoped |
Optional[Union[None, ScopedPropertySetList]]
|
Optional[Union[None, ScopedPropertySetList]]: List of values for the property for
various |
overwrite_scoped |
Optional[Literal['conflicting', 'all', 'error']]
|
Optional[Literal[“conflicting”, “all”, “error”]]: How to handle
conflicting scoped property sets. If |
existing_value_conflict |
Optional[Literal['error', 'warn', 'skip']]
|
Optional[Literal[“error”, “warn”, “skip”]]: How to handle
conflicting existing values. If |
Example: Reduce lanes by 1…but only if the existing value is 3.
Example: Set Peak Hour tolls for HOV3 and HOV2.
Source code in projectcard/models/structs.py
SelectRoadNode
¶
Selection of a single roadway node in the facility
section of a project card.
Additional properties may be used if they are defined in the roadway network node table.
Attributes:
Name | Type | Description |
---|---|---|
model_node_id |
Optional[int]
|
Optional[int]: Model node ID to select. Must have either this or
|
osm_node_id |
Optional[str]
|
Optional[str]: OSM node ID to select. Must have either this or
|
Source code in projectcard/models/structs.py
SelectRouteProperties
¶
Selection proeprties for transit routes.
Assumed to be an AND condition if more than one property is provided.
Additional properties may be used if they are defined in the transit route table.
Attributes:
Name | Type | Description |
---|---|---|
route_short_name |
Annotated[Optional[list[str]], Field(None, min_length=1)]
|
Optional[List[str]: List of Route short names to select. If more than one is provided, the selection will be based on an OR condition. Can also select based on a partial match using the ‘*’ wildcard character. |
route_long_name |
Annotated[Optional[list[str]], Field(None, min_length=1)]
|
Optional[List[str]: List of Route long names to select. If more than one is provided, the selection will be based on an OR condition. Can also select based on a partial match using the ‘*’ wildcard character. |
agency_id |
Annotated[Optional[list[str]], Field(None, min_length=1)]
|
Optional[List[str]: List of Agency IDs to select. If more than one is provided, the selection will be based on an OR condition. Can also select based on a partial match using the ‘*’ wildcard character. |
route_type |
Annotated[Optional[list[int]], Field(None, min_length=1)]
|
Optional[List[int]: List of Route types to select. If more than one is provided, the selection will be based on an OR condition. Can also select based on a partial match using the ‘*’ wildcard character. |
Source code in projectcard/models/structs.py
SelectTransitLinks
¶
Requirements for describing multiple transit links of a project card.
Attributes:
Name | Type | Description |
---|---|---|
model_link_id |
Annotated[Optional[list[int]], Field(min_length=1)]
|
Optional[List[int]]: List of model link IDs to select. If more than one is
provided, the selection will be OR or AND based on the |
ab_nodes |
Annotated[Optional[list[TransitABNodes]], Field(min_length=1)]
|
Optional[List[TransitABNodes]]: List of AB nodes to select. If more than one is
provided, the selection will be OR or AND based on the |
require |
Optional[Literal['any', 'all']]
|
Optional[Literal[“any”, “all”]]: Require either any or all of the selected links to meet the selection criteria. |
Example: Select transit trips with links using nodes 1-2 OR 3-4.
Example: Select transit trips with links using model link IDs 123 AND 321.
Source code in projectcard/models/structs.py
SelectTransitNodes
¶
Selecting trips that use transit nodes.
Attributes:
Name | Type | Description |
---|---|---|
stop_id |
Annotated[list[int], Field(min_length=1)]
|
List[int]: List of model node IDs to select. Must have at least one node.
Multiple nodes are treated as an OR or AND based on the |
require |
Optional[Literal['any', 'all']]
|
Optional[Literal[“any”, “all”]]: Require either any or all of the selected nodes to meet the selection criteria. |
Source code in projectcard/models/structs.py
SelectTripProperties
¶
Selection properties for transit trips.
Assumed to be an AND condition if more than one property is provided.
Additional properties may be used if they are defined in the transit trip table.
Attributes:
Name | Type | Description |
---|---|---|
trip_id |
Annotated[Optional[list[str]], Field(None, misn_length=1)]
|
Optional[List[str]: List of Trip IDs to select. If more than one is provided, the selection will be based on an OR condition. Can also select based on a partial match using the ‘*’ wildcard character. |
shape_id |
Annotated[Optional[list[str]], Field(None, min_length=1)]
|
Optional[List[str]: List of Shape IDs to select. If more than one is provided, the selection will be based on an OR condition. Can also select based on a partial match using the ‘*’ wildcard character. |
direction_id |
Optional[Literal[0, 1]]
|
Optional[Literal[0, 1]]: Direction ID to select. |
service_id |
Annotated[Optional[list[str]], Field(None, min_length=1)]
|
Optional[List[str]: List Service IDs to select. If more than one is provided, the selection will be based on an OR condition. Can also select based on a partial match using the ‘*’ wildcard character. |
route_id |
Annotated[Optional[list[str]], Field(None, min_length=1)]
|
Optional[List[str]: List of Route IDs to select. If more than one is provided, the selection will be based on an OR condition. Can also select based on a partial match using the ‘*’ wildcard character. |
trip_short_name |
Annotated[Optional[list[str]], Field(None, min_length=1)]
|
Optional[List[str]: List Trip short names to select. If more than one is provided, the selection will be based on an OR condition. Can also select based on a partial match using the ‘*’ wildcard character. |
Source code in projectcard/models/structs.py
TransitABNodes
¶
TransitPropertyChange_PropertyChanges
¶
Value for setting a single property value for transit.
Source code in projectcard/models/structs.py
TransitRoute
¶
Description of a new transit route.
Attributes:
Name | Type | Description |
---|---|---|
route_id |
str
|
|
agency_id |
str
|
|
route_short_name |
Optional[str]
|
Optional[str]: Route short name for the route. See GTFS for more information: https://gtfs.org/reference/static/#routes.txt. |
route_long_name |
Optional[str]
|
Optional[str]: Route long name for the route. See GTFS for more information: https://gtfs.org/reference/static/#routes.txt. |
route_type |
int
|
|
trips |
Annotated[list[TransitTrip], Field(min_length=1)]
|
list[TransitTrip]: List of trips for the route. Must have at least one trip. |
Source code in projectcard/models/structs.py
TransitRoutingChange_Routing
¶
Value for setting routing change for transit.
Attributes:
Name | Type | Description |
---|---|---|
existing |
list[int]
|
list[int]: list of |
set |
list[int]
|
list[int]: list of |
Source code in projectcard/models/structs.py
TransitStopProps
¶
Representation of details about a single transit stop for a new route.
Must have at at least either:
stop
-
board
andalight
-
If
stop
is True, thenboard
andalight
are assumed to be True unless otherwise specified. - If
stop
is False, thenboard
andalight
are assumed to be False unless otherwise specified.
Attributes:
Name | Type | Description |
---|---|---|
stop |
Optional[bool]
|
Optional[bool]: True if the stop is a stop on the route. |
dwell_secs |
Optional[PositiveInt]
|
Optional[PositiveInt]: Dwell time in seconds at the stop. |
time_to_next_node_sec |
Optional[PositiveInt]
|
Optional[PositiveInt]: Time in seconds to the next node. |
board |
Optional[bool]
|
Optional[bool]: True if the stop is a boarding stop. |
alight |
Optional[bool]
|
Optional[bool]: True if the stop is an alighting stop. |
Source code in projectcard/models/structs.py
TransitTrip
¶
Description of a new transit trip.
Additional properties may be used so long as they do not conflict with the fields:
trip_id
, shape_id
, and route_id
. route_id
is provided at the route-level and
trip_id
, shape_id
are managed by Wrangler in order to ensure primary and foreign
key constraints are met.
Attributes:
Name | Type | Description |
---|---|---|
headway_secs |
Annotated[list[TransitHeadways], Field(min_length=1)]
|
list[TransitHeadways]: List of headways for the trip - each of which is a
dictionary of a single timespans and headway value. Must have at least one headway.
Example: |
routing |
TransitRouting
|
stop properties. |
service_id |
Optional[str]
|
Optional[str]: Service ID for the trip. See GTFS for more information: https://gtfs.org/reference/static/#trips.txt. |
trip_headsign |
Optional[str]
|
Optional[str]: Trip headsign. See GTFS for more information: https://gtfs.org/reference/static/#trips.txt. |
trip_short_name |
Optional[str]
|
Optional[str]: Trip short name. See GTFS for more information: https://gtfs.org/reference/static/#trips.txt. |
direction_id |
Optional[int]
|
Optional[int]: Direction ID for the trip. Must be either 0 or 1. See GTFS for more information: https://gtfs.org/reference/static/#trips.txt. |
Example: New Transit Trip
Source code in projectcard/models/structs.py
Supporting Types ¶
Field types for the projectcard models.
MLAccessEgress = Union[Literal['all'], list[int]]
module-attribute
¶
Determines how managed lanes can be accessed from the general purpose lanes as represented
by connector links. If all
is specied, all managed lanes will be able to access managed lanes.
Otherwise, a list of node IDs where access is allowed is provided. If nothing is specified for
a continuous managed lane, access is assumed to be allowed at all nodes.
Mode = Literal['drive', 'walk', 'bike', 'transit', 'any']
module-attribute
¶
Which modes are searched for. If any
is specified, all modes are searched for.
OsmRoadwayType = Literal['taz', 'motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified', 'residential', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link', 'living_street', 'service', 'pedestrian', 'footway', 'steps', 'cycleway', 'track', 'bus_guideway', 'road']
module-attribute
¶
Open Street Map Roadway Types. See: https://wiki.openstreetmap.org/wiki/Key:highway.
TimeString = Annotated[str, Field(description='A time string in the format HH:MM or HH:MM:SS', pattern='^(\\d+):([0-5]\\d)(:[0-5]\\d)?$')]
module-attribute
¶
A HH:MM or HH:MM:SS time string. Example: "23:44"
.
Timespan = Annotated[list[TimeString], Field(examples=[['12:00', '19:45:00']], max_length=2, min_length=2)]
module-attribute
¶
A list of two time strings representing a start and end time for a time span.
Example: ["12:00", "19:45:00"]
.