diff --git a/main/examples/index.html b/main/examples/index.html index f2ad324..f24e120 100644 --- a/main/examples/index.html +++ b/main/examples/index.html @@ -706,7 +706,7 @@
changes
Category: Multiple: Roadway Addition, Roadway Deletion +
Category: Multiple: Roadway Deletion, Roadway Addition
project: convert intersection to interchange
notes: demonstrates how to nest multiple changes into a single project under `changes`
changes:
@@ -1209,7 +1209,7 @@ Example Add Simple Managed Lane
set: 'all'
Category: Multiple: Roadway Addition, Roadway Deletion +
Category: Multiple: Roadway Deletion, Roadway Addition
project: example roadway addition and deletion
tags:
- 'add and delete roadway'
diff --git a/main/search/search_index.json b/main/search/search_index.json
index 01cea44..6361cf3 100644
--- a/main/search/search_index.json
+++ b/main/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Project Cards","text":"Project Cards represent information about a tranportation infrastructure projects sufficient for usage in a regional travel demand model. The dream is that by coding a project once(ish) in a project card, it can be re-used over and over again in various scenarios \u2013 and even be shared across agencies.
"},{"location":"#schema","title":"Schema","text":"The ProjectCard schema is represented as a json-schema in the /schema
directory. More details: json-schemas page.
The rendering of json-schema leaves a wee bit to be desired, so you might prefer revieweing the schema in datamodels.
"},{"location":"#data-model","title":"Data Model","text":"If you are working in a python environment, you might find it easier to use the pydantic data models which are synced to the json-schema. More details: datamodels page.
"},{"location":"#example-data","title":"Example Data","text":"Example project cards can be found in the /examples
directory and on the examples page as well as within the datamodels documentation.
"},{"location":"#basic-usage","title":"Basic Usage","text":"This package should generally be used to validate or update project cards.
There is also a limited object model, ProjectCard
and Python API which can be used to read and write project cards.
"},{"location":"#command-line","title":"Command Line","text":"Validate project card(s) from a directory or specific file path, optionally filtering by a tag.
validate_card card_search_dir --filter_tags ['tag_to_search_for']\n
Update older project card(s) to current format from a directory or specific file path. Cards should still be validated afterwards.
update_projectcard_schema card_search_dir output_dir\n
"},{"location":"#python-api","title":"Python API","text":"from projectcard.io import read_cards\n\n# Read in cards from a directory with the tag \"Baseline 2030\"\nproject_cards = read_cards(directory, filter_tags=[\"Baseline2030\"])\n\n# Iterate through a deck of cards for validity\nfor project_name,card in project_cards.items():\n print(f\"{project_name}: {card.valid}\")\n\n# Print out a summary of the card with the project name \"4th Ave Busway\"\nprint(project_cards[\"4th Ave Busway\"])\n
For more examples and detail, pleae see the API page.
"},{"location":"#installation","title":"Installation","text":"pip install projectcard\n
Note
It is not generally necessary to install the projectcard package yourself unless you are using it to do independent validation of project cards. Projects such as network_wrangler
that use the projectcard
package to validate project cards usually include projectcard
as a requirement and install it on their own.
Plan on developing in network wrangler?
You might want to follow the directions in the development documentation.
"},{"location":"#companion-software","title":"Companion Software","text":"NetworkWrangler: While ProjectCard can stand alone, it was initially developed to be used with the NetworkWrangler network scenario management software.
ProjectCardRegistry: Example project card registries can be useful for storing collections of project cards, tracking their changes, and making sure project names are not duplicated.
"},{"location":"#having-an-issue","title":"Having an issue?","text":"\ud83e\udeb2 ProjectCard may contain bugs.
\ud83e\udd14 Also, since it has primarily been used by its developers, the documentation may contain some omissions or not be entirely clear.
But we\u2019d love to make it better! Please report bugs or incorrect/unclear/missing documentation with a GitHub Issue - or fix them yourself with a pull request!
"},{"location":"#who-dat","title":"Who-dat?","text":"ProjectCard was developed using resources from the Metropolitan Transportation Commission, Metropolitan Council MN, and in-kind time from UrbanLabs LLC and WSP. It is currently maintained using in-kind time\u2026so please be patient.
"},{"location":"#release-history","title":"Release History","text":"Notable changes and version history.
Version Date Comment v0.3.1 2024-10-07 Improved resilience of read_cards()
including ability to handle relative paths. v0.3.0 2024-09-27 Added transit addition and deletion change types. v0.2.0 2024-09-08 Read cards from nested folders. v0.1.2 2024-08-05 - v0.1.1 2024-06-20 Initial release on PyPI"},{"location":"api/","title":"API","text":""},{"location":"api/#basic-usage","title":"Basic Usage","text":"from projectcard.io import read_cards\n\n# Read in cards from a directory with the tag \"Baseline 2030\"\nproject_cards = read_cards(directory, filter_tags=[\"Baseline2030\"])\n\n# Iterate through a deck of cards for validity\nfor project_name,card in project_cards.items():\n print(f\"{project_name}: {card.valid}\")\n\n# Print out a summary of the card with the project name \"4th Ave Busway\"\nprint(project_cards[\"4th Ave Busway\"])\n
Project Card class for project card data schema.
Functions for reading and writing project cards.
Validates ProjectCard JSON data against a JSON schema.
"},{"location":"api/#projectcard.projectcard.ProjectCard","title":"ProjectCard
","text":"Representation of a Project Card.
Attributes:
Name Type Description __dict__
Dictionary of project card attributes
project
Name of project
dependencies
dict
Dependencies of project
tags
list[str]
Tags of project
notes
str
Notes about project
valid
bool
Boolean indicating if data conforms to project card data schema
facilities
list[dict]
List of all facility objects in project card
facility
Union[str, dict]
either singular facility in project card or the string \u201cmultiple\u201d
all_property_changes
Union[str, dict]
List of all property_changes objects in project card
property_changes
Union[str, dict]
either singular property_changes in project card or the string \u201cmultiple\u201d
change_types
list[str]
List of all project types in project card
change_type
str
either singular project type in project card or the string \u201cmultiple\u201d
sub_projects
str
list of sub_project objects
Source code in projectcard/projectcard.py
class ProjectCard:\n \"\"\"Representation of a Project Card.\n\n Attributes:\n __dict__: Dictionary of project card attributes\n project: Name of project\n dependencies: Dependencies of project\n tags: Tags of project\n notes: Notes about project\n valid: Boolean indicating if data conforms to project card data schema\n facilities: List of all facility objects in project card\n facility: either singular facility in project card or the string \"multiple\"\n all_property_changes: List of all property_changes objects in project card\n property_changes: either singular property_changes in project card or the string \"multiple\"\n change_types: List of all project types in project card\n change_type: either singular project type in project card or the string \"multiple\"\n sub_projects: list of sub_project objects\n \"\"\"\n\n def __init__(self, attribute_dictonary: dict, use_defaults: bool = True):\n \"\"\"Constructor for ProjectCard object.\n\n Args:\n attribute_dictonary: a nested dictionary of attributes\n use_defaults: if True, will use default values for missing required attributes,\n if exist in schema. Defaults to True.\n \"\"\"\n # add these first so they are first on write out\n self.tags: list[str] = []\n self.dependencies: dict = {}\n self.notes: str = \"\"\n self._sub_projects: list[SubProject] = []\n if use_defaults:\n attribute_dictonary = update_dict_with_schema_defaults(attribute_dictonary)\n self.__dict__.update(attribute_dictonary)\n for sp in self.__dict__.get(\"changes\", []):\n sp_obj = SubProject(sp, self)\n self._sub_projects.append(sp_obj)\n\n def __str__(self):\n \"\"\"String representation of project card.\"\"\"\n s = [f\"{key}: {value}\" for key, value in self.__dict__.items()]\n return \"\\n\".join(s)\n\n def validate(self) -> bool:\n \"\"\"Return True if project card is valid, False otherwise.\"\"\"\n return validate_card(self.__dict__)\n\n @property\n def to_dict(self) -> dict:\n \"\"\"Return dictionary of public project card attributes.\"\"\"\n return {k: v for k, v in self.__dict__.items() if not k.startswith(\"_\") and v is not None}\n\n @property\n def valid(self) -> bool:\n \"\"\"Return True if project card is valid, False otherwise.\"\"\"\n try:\n self.validate()\n except ProjectCardValidationError as e:\n CardLogger.error(f\"Project {self.project} is not valid: {e}\")\n return False\n return True\n\n @property\n def facilities(self) -> list[dict]:\n \"\"\"Return all facilities from project card as list of dicts.\"\"\"\n if any(\"transit\" in t for t in self.change_types):\n CardLogger.warning(\"Transit project doesn't have services.\")\n return []\n f = list(_findkeys(self.__dict__, \"facility\"))\n if not f:\n msg = f\"Couldn't find facility in project card {self.project}\"\n raise ProjectCardValidationError(msg)\n return f\n\n @property\n def facility(self) -> Union[str, dict]:\n \"\"\"Return facility part of project card or \"multiple\" if more than one.\"\"\"\n f = self.facilities\n if len(f) > 1:\n return \"multiple\"\n return f[0]\n\n @property\n def services(self) -> list[dict]:\n \"\"\"Return all services from project card as list of dicts.\"\"\"\n if any(\"roadway\" in t for t in self.change_types):\n CardLogger.warning(\"Roadway project doesn't have services.\")\n return []\n s = list(_findkeys(self.__dict__, \"service\"))\n if not s:\n msg = f\"Couldn't find service in project card {self.project}\"\n raise ProjectCardValidationError(msg)\n return s\n\n @property\n def service(self) -> Union[str, dict]:\n \"\"\"Return service part of from project card or \"multiple\" if more than one.\"\"\"\n s = self.services\n if len(s) > 1:\n return \"multiple\"\n return s[0]\n\n @property\n def all_transit_property_changes(self) -> list[dict]:\n \"\"\"Return all transit property changes from project card.\"\"\"\n if not any(\"transit_property_change\" in t for t in self.change_types):\n CardLogger.warning(f\"Project {self.project} doesn't have transit property changes.\")\n return []\n tp = list(_findkeys(self.__dict__, \"transit_property_change\"))\n p = [i[\"property_changes\"] for i in tp]\n return p\n\n @property\n def transit_property_change(self) -> Union[str, dict]:\n \"\"\"Return transit property change from project card or \"multiple if more than one.\"\"\"\n p = self.all_transit_property_changes\n if len(p) > 1:\n return \"multiple\"\n return p[0]\n\n @property\n def all_transit_routing_changes(self) -> list[dict]:\n \"\"\"Return all transit routing changes from project card.\"\"\"\n if not any(\"transit_routing_change\" in t for t in self.change_types):\n CardLogger.warning(f\"Project {self.project} doesn't have routing changes.\")\n return []\n r = list(_findkeys(self.__dict__, \"routing\"))\n CardLogger.debug(f\"transit routing change: {r}\")\n return r\n\n @property\n def transit_routing_change(self) -> Union[str, dict]:\n \"\"\"Return transit routing change from project card.\"\"\"\n p = self.all_transit_routing_changes\n if len(p) > 1:\n return \"multiple\"\n return p[0]\n\n @property\n def change_types(self) -> list[str]:\n \"\"\"Returns list of all change types from project/subproject.\"\"\"\n if self._sub_projects:\n return [sp.change_type for sp in self._sub_projects]\n\n type_keys = [k for k in self.__dict__ if k in CHANGE_TYPES]\n if not type_keys:\n msg = f\"Couldn't find type of project card {self.project}\"\n raise ProjectCardValidationError(msg)\n return type_keys\n\n @property\n def change_type(self) -> str:\n \"\"\"Return single change type if single project or \"multiple\" if >1 subproject.\"\"\"\n t = self.change_types\n if len(t) > 1:\n return \"multiple\"\n return t[0]\n
"},{"location":"api/#projectcard.projectcard.ProjectCard.all_transit_property_changes","title":"all_transit_property_changes: list[dict]
property
","text":"Return all transit property changes from project card.
"},{"location":"api/#projectcard.projectcard.ProjectCard.all_transit_routing_changes","title":"all_transit_routing_changes: list[dict]
property
","text":"Return all transit routing changes from project card.
"},{"location":"api/#projectcard.projectcard.ProjectCard.change_type","title":"change_type: str
property
","text":"Return single change type if single project or \u201cmultiple\u201d if >1 subproject.
"},{"location":"api/#projectcard.projectcard.ProjectCard.change_types","title":"change_types: list[str]
property
","text":"Returns list of all change types from project/subproject.
"},{"location":"api/#projectcard.projectcard.ProjectCard.facilities","title":"facilities: list[dict]
property
","text":"Return all facilities from project card as list of dicts.
"},{"location":"api/#projectcard.projectcard.ProjectCard.facility","title":"facility: Union[str, dict]
property
","text":"Return facility part of project card or \u201cmultiple\u201d if more than one.
"},{"location":"api/#projectcard.projectcard.ProjectCard.service","title":"service: Union[str, dict]
property
","text":"Return service part of from project card or \u201cmultiple\u201d if more than one.
"},{"location":"api/#projectcard.projectcard.ProjectCard.services","title":"services: list[dict]
property
","text":"Return all services from project card as list of dicts.
"},{"location":"api/#projectcard.projectcard.ProjectCard.to_dict","title":"to_dict: dict
property
","text":"Return dictionary of public project card attributes.
"},{"location":"api/#projectcard.projectcard.ProjectCard.transit_property_change","title":"transit_property_change: Union[str, dict]
property
","text":"Return transit property change from project card or \u201cmultiple if more than one.
"},{"location":"api/#projectcard.projectcard.ProjectCard.transit_routing_change","title":"transit_routing_change: Union[str, dict]
property
","text":"Return transit routing change from project card.
"},{"location":"api/#projectcard.projectcard.ProjectCard.valid","title":"valid: bool
property
","text":"Return True if project card is valid, False otherwise.
"},{"location":"api/#projectcard.projectcard.ProjectCard.__init__","title":"__init__(attribute_dictonary, use_defaults=True)
","text":"Constructor for ProjectCard object.
Parameters:
Name Type Description Default attribute_dictonary
dict
a nested dictionary of attributes
required use_defaults
bool
if True, will use default values for missing required attributes, if exist in schema. Defaults to True.
True
Source code in projectcard/projectcard.py
def __init__(self, attribute_dictonary: dict, use_defaults: bool = True):\n \"\"\"Constructor for ProjectCard object.\n\n Args:\n attribute_dictonary: a nested dictionary of attributes\n use_defaults: if True, will use default values for missing required attributes,\n if exist in schema. Defaults to True.\n \"\"\"\n # add these first so they are first on write out\n self.tags: list[str] = []\n self.dependencies: dict = {}\n self.notes: str = \"\"\n self._sub_projects: list[SubProject] = []\n if use_defaults:\n attribute_dictonary = update_dict_with_schema_defaults(attribute_dictonary)\n self.__dict__.update(attribute_dictonary)\n for sp in self.__dict__.get(\"changes\", []):\n sp_obj = SubProject(sp, self)\n self._sub_projects.append(sp_obj)\n
"},{"location":"api/#projectcard.projectcard.ProjectCard.__str__","title":"__str__()
","text":"String representation of project card.
Source code in projectcard/projectcard.py
def __str__(self):\n \"\"\"String representation of project card.\"\"\"\n s = [f\"{key}: {value}\" for key, value in self.__dict__.items()]\n return \"\\n\".join(s)\n
"},{"location":"api/#projectcard.projectcard.ProjectCard.validate","title":"validate()
","text":"Return True if project card is valid, False otherwise.
Source code in projectcard/projectcard.py
def validate(self) -> bool:\n \"\"\"Return True if project card is valid, False otherwise.\"\"\"\n return validate_card(self.__dict__)\n
"},{"location":"api/#projectcard.projectcard.SubProject","title":"SubProject
","text":"Representation of a SubProject within a ProjectCard.
Attributes:
Name Type Description parent_project
ProjectCard
reference to parent ProjectCard object
type
ProjectCard
project type
tags
list[str]
reference to parent project card tags
dependencies
dict
reference to parent project card\u2019s dependencies
project
str
reference to the name of the parent project card\u2019s name
facility
dict
facility selection dictionary
property_changes
dict
property_changes dictionary
Source code in projectcard/projectcard.py
class SubProject:\n \"\"\"Representation of a SubProject within a ProjectCard.\n\n Attributes:\n parent_project: reference to parent ProjectCard object\n type: project type\n tags: reference to parent project card tags\n dependencies: reference to parent project card's dependencies\n project: reference to the name of the parent project card's name\n facility: facility selection dictionary\n property_changes:property_changes dictionary\n \"\"\"\n\n def __init__(self, sp_dictionary: dict, parent_project: ProjectCard):\n \"\"\"Constructor for SubProject object.\n\n Args:\n sp_dictionary (dict): dictionary of sub-project attributes contained within \"changes\"\n list of parent projet card\n parent_project (ProjectCard): ProjectCard object for parent project card\n\n \"\"\"\n self._parent_project = parent_project\n\n if len(sp_dictionary) != 1:\n msg = f\"Subproject of {parent_project.project} should only have one change. Found {len(sp_dictionary)} changes.\"\n CardLogger.error(\n msg\n + f\" Did you forget to indent the rest of this change?\\nKeys: {sp_dictionary.keys()}\"\n )\n raise SubprojectValidationError(msg)\n self._change_type = next(iter(sp_dictionary.keys()))\n self.__dict__.update(sp_dictionary)\n self._sub_projects: list[SubProject] = []\n\n @property\n def change_type(self) -> str:\n \"\"\"Return change type from subproject.\"\"\"\n return self._change_type\n\n @property\n def parent_project(self) -> ProjectCard:\n \"\"\"Return parent project from parent project card.\"\"\"\n return self._parent_project\n\n @property\n def project(self) -> str:\n \"\"\"Return project name from parent project card.\"\"\"\n return self._parent_project.project\n\n @property\n def dependencies(self) -> dict:\n \"\"\"Return dependencies from parent project card.\"\"\"\n return self._parent_project.dependencies\n\n @property\n def tags(self) -> list[str]:\n \"\"\"Return tags from parent project card.\"\"\"\n return self._parent_project.tags\n\n @property\n def facility(self) -> dict:\n \"\"\"Return facility dictionary from subproject.\"\"\"\n f = list(_findkeys(self.__dict__, \"facility\"))\n if not f:\n msg = f\"Couldn't find facility in subproject in project card {self._parent_project.project}\"\n raise SubprojectValidationError(msg)\n return f[0]\n\n @property\n def valid(self) -> bool:\n \"\"\"Check if subproject is valid.\"\"\"\n return self._parent_project.valid\n
"},{"location":"api/#projectcard.projectcard.SubProject.change_type","title":"change_type: str
property
","text":"Return change type from subproject.
"},{"location":"api/#projectcard.projectcard.SubProject.dependencies","title":"dependencies: dict
property
","text":"Return dependencies from parent project card.
"},{"location":"api/#projectcard.projectcard.SubProject.facility","title":"facility: dict
property
","text":"Return facility dictionary from subproject.
"},{"location":"api/#projectcard.projectcard.SubProject.parent_project","title":"parent_project: ProjectCard
property
","text":"Return parent project from parent project card.
"},{"location":"api/#projectcard.projectcard.SubProject.project","title":"project: str
property
","text":"Return project name from parent project card.
"},{"location":"api/#projectcard.projectcard.SubProject.tags","title":"tags: list[str]
property
","text":"Return tags from parent project card.
"},{"location":"api/#projectcard.projectcard.SubProject.valid","title":"valid: bool
property
","text":"Check if subproject is valid.
"},{"location":"api/#projectcard.projectcard.SubProject.__init__","title":"__init__(sp_dictionary, parent_project)
","text":"Constructor for SubProject object.
Parameters:
Name Type Description Default sp_dictionary
dict
dictionary of sub-project attributes contained within \u201cchanges\u201d list of parent projet card
required parent_project
ProjectCard
ProjectCard object for parent project card
required Source code in projectcard/projectcard.py
def __init__(self, sp_dictionary: dict, parent_project: ProjectCard):\n \"\"\"Constructor for SubProject object.\n\n Args:\n sp_dictionary (dict): dictionary of sub-project attributes contained within \"changes\"\n list of parent projet card\n parent_project (ProjectCard): ProjectCard object for parent project card\n\n \"\"\"\n self._parent_project = parent_project\n\n if len(sp_dictionary) != 1:\n msg = f\"Subproject of {parent_project.project} should only have one change. Found {len(sp_dictionary)} changes.\"\n CardLogger.error(\n msg\n + f\" Did you forget to indent the rest of this change?\\nKeys: {sp_dictionary.keys()}\"\n )\n raise SubprojectValidationError(msg)\n self._change_type = next(iter(sp_dictionary.keys()))\n self.__dict__.update(sp_dictionary)\n self._sub_projects: list[SubProject] = []\n
"},{"location":"api/#projectcard.io.dict_to_yaml_with_comments","title":"dict_to_yaml_with_comments(d)
","text":"Converts a dictionary to a YAML string with comments.
Source code in projectcard/io.py
def dict_to_yaml_with_comments(d):\n \"\"\"Converts a dictionary to a YAML string with comments.\"\"\"\n yaml_str = yaml.dump(d, default_flow_style=False, sort_keys=False)\n yaml_lines = yaml_str.splitlines()\n final_yaml_lines = []\n\n for line in yaml_lines:\n if \"#\" in line:\n final_yaml_lines.append(f\"#{line}\")\n else:\n final_yaml_lines.append(line)\n\n return \"\\n\".join(final_yaml_lines)\n
"},{"location":"api/#projectcard.io.read_card","title":"read_card(filepath, validate=False)
","text":"Read single project card from a path and return project card object.
Parameters:
Name Type Description Default filepath
ProjectCardFilepath
file where the project card is.
required validate
bool
if True, will validate the project card schemea
False
Source code in projectcard/io.py
def read_card(filepath: ProjectCardFilepath, validate: bool = False):\n \"\"\"Read single project card from a path and return project card object.\n\n Args:\n filepath: file where the project card is.\n validate: if True, will validate the project card schemea\n \"\"\"\n if not Path(filepath).is_file():\n msg = f\"Cannot find project card file: {filepath}\"\n raise FileNotFoundError(msg)\n card_dict = read_cards(filepath)\n card = next(iter(card_dict.values()))\n if validate:\n card.validate()\n return card\n
"},{"location":"api/#projectcard.io.read_cards","title":"read_cards(filepath, filter_tags=None, recursive=False, base_path=DEFAULT_BASE_PATH, existing_projects=None)
","text":"Reads collection of project card files by inferring the file type.
Lowercases all keys, but then replaces any that need to be uppercased using the REPLACE_KEYS mapping. Needed to keep \u201cA\u201d and \u201cB\u201d uppercased.
If a path is given as a relative path, it will be resolved to an absolute path using the base_path.
Parameters:
Name Type Description Default filepath
ProjectCardFilepaths
where the project card is. A single path, list of paths, a directory, or a glob pattern.
required filter_tags
Optional[list[str]]
list of tags to filter by.
None
recursive
bool
if True, will search recursively in subdirs.
False
base_path
Path
base path to resolve relative paths from. Defaults to current working directory.
DEFAULT_BASE_PATH
existing_projects
Optional[list[str]]
list of existing project names to check for uniqueness.
None
Source code in projectcard/io.py
def read_cards(\n filepath: ProjectCardFilepaths,\n filter_tags: Optional[list[str]] = None,\n recursive: bool = False,\n base_path: Path = DEFAULT_BASE_PATH,\n existing_projects: Optional[list[str]] = None,\n) -> dict[str, ProjectCard]:\n \"\"\"Reads collection of project card files by inferring the file type.\n\n Lowercases all keys, but then replaces any that need to be uppercased using the\n REPLACE_KEYS mapping. Needed to keep \"A\" and \"B\" uppercased.\n\n If a path is given as a relative path, it will be resolved to an absolute path using\n the base_path.\n\n Args:\n filepath: where the project card is. A single path, list of paths,\n a directory, or a glob pattern.\n filter_tags: list of tags to filter by.\n recursive: if True, will search recursively in subdirs.\n base_path: base path to resolve relative paths from. Defaults to current working directory.\n existing_projects: list of existing project names to check for uniqueness.\n\n Returns: dictionary of project cards by project name\n \"\"\"\n CardLogger.debug(f\"Reading cards from {filepath}.\")\n filter_tags = filter_tags or []\n filter_tags = list(map(str.lower, filter_tags))\n cards = {}\n\n filepath = _resolve_rel_paths(filepath, base_path=base_path)\n if isinstance(filepath, list) or filepath.is_dir():\n card_paths = _get_cardpath_list(filepath, valid_ext=VALID_EXT, recursive=recursive)\n for p in card_paths:\n project_card = _read_card(\n p, filter_tags=filter_tags, existing_projects=existing_projects\n )\n if project_card is None:\n continue\n if project_card.project in cards:\n msg = f\"Project names not unique from projects being read in together in `read_cards()`: {project_card.project}\"\n raise ProjectCardReadError(msg)\n cards[project_card.project] = project_card\n else:\n project_card = _read_card(\n filepath, filter_tags=filter_tags, existing_projects=existing_projects\n )\n if project_card is not None:\n cards[project_card.project] = project_card\n if len(cards) == 0:\n CardLogger.warning(\"No project cards found with given parameters.\")\n return cards\n
"},{"location":"api/#projectcard.io.write_card","title":"write_card(project_card, filename=None)
","text":"Writes project card dictionary to YAML file.
Source code in projectcard/io.py
def write_card(project_card, filename: Optional[Path] = None):\n \"\"\"Writes project card dictionary to YAML file.\"\"\"\n from .utils import make_slug\n\n default_filename = make_slug(project_card.project) + \".yml\"\n filename = filename or Path(default_filename)\n\n if not project_card.valid:\n CardLogger.warning(f\"{project_card.project} Project Card not valid.\")\n out_dict: dict[str, Any] = {}\n\n # Writing these first manually so that they are at top of file\n out_dict[\"project\"] = None\n if project_card.to_dict.get(\"tags\"):\n out_dict[\"tags\"] = None\n if project_card.to_dict.get(\"dependencies\"):\n out_dict[\"dependencies\"] = None\n out_dict.update(project_card.to_dict)\n for k in SKIP_WRITE:\n if k in out_dict:\n del out_dict[k]\n\n yaml_content = dict_to_yaml_with_comments(out_dict)\n\n with filename.open(\"w\") as outfile:\n outfile.write(yaml_content)\n\n CardLogger.info(f\"Wrote project card to: {filename}\")\n
"},{"location":"api/#projectcard.validate.package_schema","title":"package_schema(schema_path=PROJECTCARD_SCHEMA, outfile_path=None)
","text":"Consolidates referenced schemas into a single schema and writes it out.
Parameters:
Name Type Description Default schema_path
Union[Path, str]
Schema to read int and package. Defaults to PROJECTCARD_SCHEMA which is ROOTDIR / \u201cschema\u201d / \u201cprojectcard.json\u201d.
PROJECTCARD_SCHEMA
outfile_path
Optional[Union[Path, str]]
Where to write out packaged schema. Defaults to schema_path.basepath.packaged.json
None
Source code in projectcard/validate.py
def package_schema(\n schema_path: Union[Path, str] = PROJECTCARD_SCHEMA,\n outfile_path: Optional[Union[Path, str]] = None,\n) -> None:\n \"\"\"Consolidates referenced schemas into a single schema and writes it out.\n\n Args:\n schema_path: Schema to read int and package. Defaults to PROJECTCARD_SCHEMA which is\n ROOTDIR / \"schema\" / \"projectcard.json\".\n outfile_path: Where to write out packaged schema. Defaults\n to schema_path.basepath.packaged.json\n \"\"\"\n schema_path = Path(schema_path)\n _s_data = _load_schema(schema_path)\n default_outfile_path = schema_path.parent / f\"{schema_path.stem}packaged.{schema_path.suffix}\"\n outfile_path = outfile_path or default_outfile_path\n outfile_path = Path(outfile_path)\n with outfile_path.open(\"w\") as outfile:\n json.dump(_s_data, outfile, indent=4)\n CardLogger.info(f\"Wrote {schema_path.stem} to {outfile_path.stem}\")\n
"},{"location":"api/#projectcard.validate.update_dict_with_schema_defaults","title":"update_dict_with_schema_defaults(data, schema=PROJECTCARD_SCHEMA)
","text":"Recursively update missing required properties with default values.
Parameters:
Name Type Description Default data
dict
The data dictionary to update.
required schema
Union[Path, dict]
The schema dictionary or path to the schema file.
PROJECTCARD_SCHEMA
Returns:
Type Description dict
The updated data dictionary.
Source code in projectcard/validate.py
def update_dict_with_schema_defaults(\n data: dict, schema: Union[Path, dict] = PROJECTCARD_SCHEMA\n) -> dict:\n \"\"\"Recursively update missing required properties with default values.\n\n Args:\n data: The data dictionary to update.\n schema: The schema dictionary or path to the schema file.\n\n Returns:\n The updated data dictionary.\n \"\"\"\n if isinstance(schema, (str, Path)):\n schema = _load_schema(schema)\n\n if \"properties\" in schema:\n for prop_name, schema_part in schema[\"properties\"].items():\n # Only update if the property is required, has a default, and is not already there\n if (\n prop_name not in data\n and \"default\" in schema_part\n and prop_name in schema.get(\"required\", [])\n ):\n CardLogger.debug(f\"Adding default value for {prop_name}: {schema_part['default']}\")\n data[prop_name] = schema_part[\"default\"]\n elif (\n prop_name in data\n and isinstance(data[prop_name], dict)\n and \"properties\" in schema_part\n ):\n data[prop_name] = update_dict_with_schema_defaults(data[prop_name], schema_part)\n elif (\n prop_name in data and isinstance(data[prop_name], list) and \"items\" in schema_part\n ):\n for item in data[prop_name]:\n if isinstance(item, dict):\n update_dict_with_schema_defaults(item, schema_part[\"items\"])\n return data\n
"},{"location":"api/#projectcard.validate.validate_card","title":"validate_card(jsondata, schema_path=PROJECTCARD_SCHEMA, parse_defaults=True)
","text":"Validates json-like data to specified schema.
If pycode
key exists, will evaluate it for basic runtime errors using Flake8. Note: will not flag any invalid use of RoadwayNetwork or TransitNetwork APIs.
Parameters:
Name Type Description Default jsondata
dict
json-like data to validate.
required schema_path
Path
path to schema to validate to. Defaults to PROJECTCARD_SCHEMA which is ROOTDIR / \u201cschema\u201d / \u201cprojectcard.json\u201d
PROJECTCARD_SCHEMA
parse_defaults
bool
if True, will use default values for missing required attributes.
True
Raises:
Type Description ValidationError
If jsondata doesn\u2019t conform to specified schema.
SchemaError
If schema itself is not valid.
Source code in projectcard/validate.py
def validate_card(\n jsondata: dict, schema_path: Path = PROJECTCARD_SCHEMA, parse_defaults: bool = True\n) -> bool:\n \"\"\"Validates json-like data to specified schema.\n\n If `pycode` key exists, will evaluate it for basic runtime errors using Flake8.\n Note: will not flag any invalid use of RoadwayNetwork or TransitNetwork APIs.\n\n Args:\n jsondata: json-like data to validate.\n schema_path: path to schema to validate to.\n Defaults to PROJECTCARD_SCHEMA which is\n ROOTDIR / \"schema\" / \"projectcard.json\"\n parse_defaults: if True, will use default values for missing required attributes.\n\n Raises:\n ValidationError: If jsondata doesn't conform to specified schema.\n SchemaError: If schema itself is not valid.\n \"\"\"\n if \"project\" in jsondata:\n CardLogger.debug(f\"Validating: {jsondata['project']}\")\n try:\n _schema_data = _load_schema(schema_path)\n if parse_defaults:\n jsondata = update_dict_with_schema_defaults(jsondata, _schema_data)\n validate(jsondata, schema=_schema_data)\n except ValidationError as e:\n CardLogger.error(f\"---- Error validating {jsondata['project']} ----\")\n msg = f\"\\nRelevant schema: {e.schema}\\nValidator Value: {e.validator_value}\\nValidator: {e.validator}\"\n msg += f\"\\nabsolute_schema_path:{e.absolute_schema_path}\\nabsolute_path:{e.absolute_path}\"\n CardLogger.error(msg)\n raise ProjectCardValidationError from e\n except SchemaError as e:\n CardLogger.error(e)\n raise ProjectCardJSONSchemaError from e\n\n if \"pycode\" in jsondata:\n if \"self.\" in jsondata[\"pycode\"] and \"self_obj_type\" not in jsondata:\n msg = \"If using self, must specify what `self` refers to in yml frontmatter using self_obj_type: <RoadwayNetwork|TransitNetwork>\"\n raise PycodeError(msg)\n _validate_pycode(jsondata)\n\n return True\n
"},{"location":"api/#projectcard.validate.validate_schema_file","title":"validate_schema_file(schema_path=PROJECTCARD_SCHEMA)
","text":"Validates that a schema file is a valid JSON-schema.
Parameters:
Name Type Description Default schema_path
Path
description. Defaults to PROJECTCARD_SCHEMA which is ROOTDIR / \u201cschema\u201d / \u201cprojectcard.json\u201d.
PROJECTCARD_SCHEMA
Source code in projectcard/validate.py
def validate_schema_file(schema_path: Path = PROJECTCARD_SCHEMA) -> bool:\n \"\"\"Validates that a schema file is a valid JSON-schema.\n\n Args:\n schema_path: _description_. Defaults to PROJECTCARD_SCHEMA which is\n ROOTDIR / \"schema\" / \"projectcard.json\".\n \"\"\"\n try:\n _schema_data = _load_schema(schema_path)\n # _resolver = _ref_resolver(schema_path,_schema_data)\n validate({}, schema=_schema_data) # ,resolver=_resolver)\n except ValidationError:\n pass\n except SchemaError as e:\n CardLogger.error(e)\n raise ProjectCardJSONSchemaError from e\n\n return True\n
"},{"location":"datamodels/","title":"Project Card Data Model","text":"Warning
These models are not the canonical schema and may or may not be completely accurate and up to date \u2013 although we try our best. The canonical schema is maintained in json-schema format and is documented on the schemas page \u2013 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.
"},{"location":"datamodels/#projectcard.models.project.ProjectModel--grouping-related-changes","title":"Grouping Related Changes:","text":"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, \u201cproject\u201d, they should be careful to ensure that the changes are logically related and would likely be implemented together.
"},{"location":"datamodels/#projectcard.models.project.ProjectModel--phased-projects","title":"Phased Projects:","text":"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.
"},{"location":"datamodels/#projectcard.models.project.ProjectModel--dependencies","title":"Dependencies:","text":"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).
"},{"location":"datamodels/#projectcard.models.project.ProjectModel--tags","title":"Tags:","text":"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
.
"},{"location":"datamodels/#projectcard.models.project.ProjectModel--formats-serialization","title":"Formats + Serialization:","text":"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\u2026each of which is a list of project names.
changes
Optional[list[ChangeTypes]]
List of one or more changes. Must either have changes
or a single change type (e.g. roadway_property_change
, transit_property_change
, etc.). If changes
is provided, cannot specify another change outside of changes.
roadway_property_change
Optional[RoadwayPropertyChanges]
A single roadway property change. Cannot be used with changes
or another change type.
roadway_deletion
Optional[RoadwayDeletion]
A single roadway deletion change. Cannot be used with changes
or another change type.
roadway_addition
Optional[RoadwayAddition]
A single roadway addition change. Cannot be used with changes
or another change type.
transit_property_change
Optional[TransitPropertyChange]
A single Transit property change. Cannot be used with changes
or another change type.
transit_routing_change
Optional[TransitRoutingChange]
A single Transit routing change. Cannot be used with changes
or another change type.
transit_service_deletion
Optional[TransitServiceDeletion]
A single Transit service deletion change. Cannot be used with changes
or another change type.
transit_route_addition
Optional[TransitRouteAddition]
A single transit route addition change. Cannot be used with changes
or another change type.
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 changes
or another change type.
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 changes
or another change type.
Example Project Card
project: \"Add new bus route\"\nnotes: \"This project adds a new bus route to the network.\"\ntags: [\"bus\", \"transit\"]\ndependencies:\n conflicts: [\"Remove bus route\"]\n prerequisites: [\"Add bus stop\"]\n corequisites: [\"Add bus route\"]\ntransit_route_addition: ...\n
Source code in projectcard/models/project.py
class ProjectModel(BaseModel):\n \"\"\"ProjectCard Data Model.\n\n ProjectCards are a set of information that describe an infrastructure project or change to a\n network. They are used to document and manage changes to a network such as adding a new bus\n route, changing a roadway property, changing the number of lanes on a roadway, or increasing\n transit service frequency.\n\n ProjectCards are composed of one or more **changes**. Each change is a specific type of change\n that happens to a specific portion, or **selection** of the network, such as a roadway\n property change, transit property change, or transit route addition. Each change type has\n its own set of parameters that describe the change in detail.\n\n #### Grouping Related Changes:\n When more than one change is needed to describe a project, the `changes` field can be used to\n specify a list of changes. This is useful when a project requires multiple changes to be made\n to the network. For example, a project to add a new bus route may require adding new bus lanes\n to the roadway network. Or adding a new, mid-block bus-route may require adding a new bus stop\n as a node in the roadway network and splitting the link.\n\n While the user can choose what changes should be grouped together into a single,\n \"project\", they should be careful to ensure that the changes are logically related and would\n likely be implemented together.\n\n #### Phased Projects:\n In cases where a project maybe implemented in multiple phases, it is recommended to create\n separate project cards for each phase. This will help to ensure that the project can be\n in a network similar to how it would be implemented in the real world.\n\n #### Dependencies:\n If a project requires another project to be implemented first, the `pre-requisites` field\n of `dependencies` can be used. Similarly, if a project would be impossible to implement\n if another project is implemented, the `conflicts` field of `dependencies` can be used.\n `corequisites` can be used to specify projects that must be implemented at the same time -\n noting that if Project A specifies Project B as a corequisite, then Project B need not specify\n Project A as a corequisite (if they were dependent upon each other, then they should likely\n be combined into a single project).\n\n #### Tags:\n Tags can be used to categorize projects and make it easier to search for projects that are\n related to a specific topic or type of project. For example, a collection of projects that are\n considered to be in your committed future baseline because they have committed funding could\n be tagged as `committed`.\n\n #### Formats + Serialization:\n ProjectCards can be represented within memory as any structured data format such as JSON,\n Python Dictionaries, or a Struct. They can also be serialized to any nested file format that\n is compatible with [JSON-schema ](https://json-schema.org) such as YAML, TOML, or JSON.\n For the purposes of this documentation, we will use YAML as the serialization format for\n the examples becuase it is less verbose than JSON and python dictonaries and easier to read.\n\n List of tools that support json-schema: <https://json-schema.org/tools>\n\n Attributes:\n project (str): The name of the project. This name must be unique within a set of projects\n being managed or applied to a network.\n notes (Optional[str]): Additional freeform notes about the project.\n tags (Optional[list[str]]): Tags for the project to associate the project card with a\n specific project or type of project.\n dependencies (Optional[Dependencies]): Dependencies for the project card: conflicts,\n prerequisites, and corequisites...each of which is a list of project names.\n changes (Optional[list[ChangeTypes]]): List of one or more changes. Must either have\n `changes` or a single change type (e.g. `roadway_property_change`,\n `transit_property_change`, etc.). If `changes` is provided, cannot specify another\n change outside of changes.\n roadway_property_change (Optional[RoadwayPropertyChanges]): A single roadway property\n change. Cannot be used with `changes` or another change type.\n roadway_deletion (Optional[RoadwayDeletion]): A single roadway deletion change. Cannot\n be used with `changes` or another change type.\n roadway_addition (Optional[RoadwayAddition]): A single roadway addition change. Cannot\n be used with `changes` or another change type.\n transit_property_change (Optional[TransitPropertyChange]): A single Transit property\n change. Cannot be used with `changes` or another change type.\n transit_routing_change (Optional[TransitRoutingChange]): A single Transit routing change.\n Cannot be used with `changes` or another change type.\n transit_service_deletion (Optional[TransitServiceDeletion]): A single Transit service\n deletion change. Cannot be used with `changes` or another change type.\n transit_route_addition (Optional[TransitRouteAddition]): A single transit route addition\n change. Cannot be used with `changes` or another change type.\n pycode (Optional[str]): A single pycode type change which uses python code for the project\n which refers to self as a transit or roadway network. Cannot be used with `changes` or\n another change type.\n self_obj_type (Optional[Literal[\"RoadwayNetwork\", \"TransitNetwork\"]]): Type of object\n being changed in the pycode python code. Must be either TransitNetwork or\n RoadwayNetwork. Cannot be used with `changes` or another change type.\n\n !!! Example \"Example Project Card\"\n ```yaml\n project: \"Add new bus route\"\n notes: \"This project adds a new bus route to the network.\"\n tags: [\"bus\", \"transit\"]\n dependencies:\n conflicts: [\"Remove bus route\"]\n prerequisites: [\"Add bus stop\"]\n corequisites: [\"Add bus route\"]\n transit_route_addition: ...\n ```\n \"\"\"\n\n require_one_of: ClassVar = [\n \"roadway_property_change\",\n \"roadway_deletion\",\n \"roadway_addition\",\n \"transit_property_change\",\n \"transit_routing_change\",\n \"transit_service_deletion\",\n \"transit_route_addition\",\n [\"pycode\", \"self_obj_type\"],\n \"changes\",\n ]\n\n project: str\n notes: Optional[str]\n tags: Optional[list[str]]\n dependencies: Optional[Dependencies]\n changes: Optional[list[ChangeTypes]]\n roadway_property_change: Optional[RoadwayPropertyChanges]\n roadway_deletion: Optional[RoadwayDeletion]\n roadway_addition: Optional[RoadwayAddition]\n transit_property_change: Optional[TransitPropertyChange]\n transit_routing_change: Optional[TransitRoutingChange]\n transit_service_deletion: Optional[TransitServiceDeletion]\n transit_route_addition: Optional[TransitRouteAddition]\n pycode: Optional[str]\n self_obj_type: Optional[Literal[\"RoadwayNetwork\", \"TransitNetwork\"]]\n
"},{"location":"datamodels/#change-types","title":"Change Types","text":"Change type models for project card.
"},{"location":"datamodels/#projectcard.models.changes.ChangeTypes","title":"ChangeTypes
","text":"Union of all change types.
Source code in projectcard/models/changes.py
class ChangeTypes(BaseModel):\n \"\"\"Union of all change types.\"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n require_one_of: ClassVar = [\n [\n \"roadway_property_change\",\n \"roadway_deletion\",\n \"roadway_addition\",\n \"transit_property_change\",\n \"transit_routing_change\",\n \"transit_service_deletion\",\n \"transit_route_addition\",\n \"pycode\",\n ],\n ]\n\n roadway_property_change: Optional[RoadwayPropertyChanges]\n roadway_deletion: Optional[RoadwayDeletion]\n roadway_addition: Optional[RoadwayAddition]\n transit_property_change: Optional[TransitPropertyChange]\n transit_routing_change: Optional[TransitRoutingChange]\n transit_service_deletion: Optional[TransitServiceDeletion]\n transit_route_addition: Optional[TransitRouteAddition]\n pycode: Optional[str]\n
"},{"location":"datamodels/#projectcard.models.changes.RoadwayAddition","title":"RoadwayAddition
","text":"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:\n links:\n - A: 269066\n B: 268932\n name: new neighborhood st\n roadway: residential\n lanes: 1\n model_link_id: 404982\n - A: 268932\n B: 269066\n name: new neighborhood st\n roadway: residential\n lanes: 1\n model_link_id: 407042\n nodes:\n - model_node_id: 268932\n latitude: 37.7749\n longitude: -122.4194\n - model_node_id: 269066\n latitude: 37.7749\n longitude: -122.4194\n
Source code in projectcard/models/changes.py
class RoadwayAddition(BaseModel):\n \"\"\"Requirements for describing roadway addition project card.\n\n Attributes:\n links (Optional[list[RoadLink]]): Roadway links to add. Must have at least one link.\n nodes (Optional[list[RoadNode]]): Roadway nodes to add. Must have at least one node.\n\n !!! Example \"Example Roadway Addition\"\n ```yaml\n roadway_addition:\n links:\n - A: 269066\n B: 268932\n name: new neighborhood st\n roadway: residential\n lanes: 1\n model_link_id: 404982\n - A: 268932\n B: 269066\n name: new neighborhood st\n roadway: residential\n lanes: 1\n model_link_id: 407042\n nodes:\n - model_node_id: 268932\n latitude: 37.7749\n longitude: -122.4194\n - model_node_id: 269066\n latitude: 37.7749\n longitude: -122.4194\n ```\n \"\"\"\n\n require_any_of: ClassVar = [[\"links\", \"nodes\"]]\n model_config = ConfigDict(extra=\"forbid\")\n\n links: Annotated[Optional[list[RoadLink]], Field(min_length=1)]\n nodes: Annotated[Optional[list[RoadNode]], Field(min_length=1)]\n
"},{"location":"datamodels/#projectcard.models.changes.RoadwayDeletion","title":"RoadwayDeletion
","text":"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
roadway_deletion:\n links:\n model_link_id:\n - 281\n - 477533\n nodes:\n model_node_id:\n - 314159\n clean_shapes: true\n clean_nodes: false\n
Source code in projectcard/models/changes.py
class RoadwayDeletion(BaseModel):\n \"\"\"Requirements for describing roadway deletion project card (e.g. to delete).\n\n Attributes:\n links (Optional[SelectRoadLinks]): Roadway links to delete.\n nodes (Optional[SelectRoadNodes]): Roadway nodes to delete.\n clean_shapes (bool): If True, will clean unused roadway shapes associated with the deleted links\n if they are not otherwise being used. Defaults to False.\n clean_nodes (bool): If True, will clean unused roadway nodes associated with the deleted links\n if they are not otherwise being used. Defaults to False.\n\n !!! Example \"Example Roadway Deletion\"\n ```yaml\n roadway_deletion:\n links:\n model_link_id:\n - 281\n - 477533\n nodes:\n model_node_id:\n - 314159\n clean_shapes: true\n clean_nodes: false\n ```\n \"\"\"\n\n require_any_of: ClassVar = [[\"links\", \"nodes\"]]\n model_config = ConfigDict(extra=\"forbid\")\n\n links: Optional[SelectRoadLinks] = None\n nodes: Optional[SelectRoadNodes] = None\n clean_shapes: bool = False\n clean_nodes: bool = False\n
"},{"location":"datamodels/#projectcard.models.changes.RoadwayPropertyChanges","title":"RoadwayPropertyChanges
","text":"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
roadway_property_change:\n facility:\n links:\n modes: ['drive','bike']\n osm_link_id:\n - '1234'\n - '2345'\n from:\n osm_node_id: '4321'\n to:\n osm_node_id: '4322'\n property_changes:\n lanes:\n existing: 3\n change: -1\n existing_value_conflict: error\n bicycle_facility:\n existing: 1\n set: 3\n existing_value_conflict: skip\n
Source code in projectcard/models/changes.py
class RoadwayPropertyChanges(BaseModel):\n \"\"\"Value for setting property changes for a time of day and category.\n\n Attributes:\n facility (SelectFacility): Selection of roadway links to change properties for.\n property_changes (dict[str, RoadwayPropertyChange]): Property changes to apply to the selection. Must have at least one property change.\n\n !!! Example \"Example Roadway Property Change\"\n ```yaml\n roadway_property_change:\n facility:\n links:\n modes: ['drive','bike']\n osm_link_id:\n - '1234'\n - '2345'\n from:\n osm_node_id: '4321'\n to:\n osm_node_id: '4322'\n property_changes:\n lanes:\n existing: 3\n change: -1\n existing_value_conflict: error\n bicycle_facility:\n existing: 1\n set: 3\n existing_value_conflict: skip\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n facility: SelectFacility\n property_changes: Annotated[dict[str, RoadwayPropertyChange], Field(min_length=1)]\n
"},{"location":"datamodels/#projectcard.models.changes.TransitPropertyChange","title":"TransitPropertyChange
","text":"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
transit_property_change:\n service:\n trip_properties:\n trip_id:\n - 14940701-JUN19-MVS-BUS-Weekday-01\n timespans:\n - ['06:00:00', '09:00:00']\n property_changes:\n headway_secs:\n set: 900\n
Source code in projectcard/models/changes.py
class TransitPropertyChange(BaseModel):\n \"\"\"Value for setting property change for a time of day and category.\n\n Attributes:\n service (SelectTransitTrips): Selection of transit trips to change properties for.\n property_changes (dict[str, TransitPropertyChange]): List of property changes to apply.\n\n !!! Example \"Example Transit Property Change\"\n ```yaml\n transit_property_change:\n service:\n trip_properties:\n trip_id:\n - 14940701-JUN19-MVS-BUS-Weekday-01\n timespans:\n - ['06:00:00', '09:00:00']\n property_changes:\n headway_secs:\n set: 900\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n service: SelectTransitTrips\n property_changes: Annotated[\n dict[str, TransitPropertyChange_PropertyChanges], Field(min_length=1)\n ]\n
"},{"location":"datamodels/#projectcard.models.changes.TransitRouteAddition","title":"TransitRouteAddition
","text":"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:\n routes:\n - route_id: abc\n route_long_name: green_line\n route_short_name: green\n route_type: 3\n agency_id: The Bus\n trips:\n - direction_id: 0\n headway_secs:\n - ('6:00','12:00'): 600\n - ('12:00','13:00'): 900\n routing:\n - 1:\n stop: true #when stop is set to True, defaults to allow both boarding and alighting\n - 2\n - 3\n - 4:\n stop: true # default to False, specify only when stopping\n alight: false # default to True, specify only when not default\n - 5\n - 6:\n stop: true\n
Source code in projectcard/models/changes.py
class TransitRouteAddition(BaseModel):\n \"\"\"Requirements for describing transit route addition project card.\n\n Attributes:\n routes (list[TransitRoute]): List of transit routes to be added. Must have at least one route.\n\n !!! Example \"Example Transit Route Addition\"\n ```yaml\n transit_route_addition:\n routes:\n - route_id: abc\n route_long_name: green_line\n route_short_name: green\n route_type: 3\n agency_id: The Bus\n trips:\n - direction_id: 0\n headway_secs:\n - ('6:00','12:00'): 600\n - ('12:00','13:00'): 900\n routing:\n - 1:\n stop: true #when stop is set to True, defaults to allow both boarding and alighting\n - 2\n - 3\n - 4:\n stop: true # default to False, specify only when stopping\n alight: false # default to True, specify only when not default\n - 5\n - 6:\n stop: true\n\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n routes: Annotated[list[TransitRoute], Field(min_length=1)]\n
"},{"location":"datamodels/#projectcard.models.changes.TransitRoutingChange","title":"TransitRoutingChange
","text":"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\u2019t stop noted as negative integers.
Example Transit Routing Change
transit_routing_change:\n service:\n trip_properties:\n route_id:\n - 294-111\n direction_id: 1\n routing:\n existing:\n - 1\n - 2\n set:\n - 1\n - -11\n - -12\n - 2\n
Source code in projectcard/models/changes.py
class TransitRoutingChange(BaseModel):\n \"\"\"Value for setting routing change for transit.\n\n Attributes:\n service (SelectTransitTrips): Selection of transit trips to change routing for.\n transit_routing_change (TransitRoutingChange): Existing and changed routing as denoted as a list of nodes with\n nodes where the route doesn't stop noted as negative integers.\n\n !!! Example \"Example Transit Routing Change\"\n ```yaml\n transit_routing_change:\n service:\n trip_properties:\n route_id:\n - 294-111\n direction_id: 1\n routing:\n existing:\n - 1\n - 2\n set:\n - 1\n - -11\n - -12\n - 2\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n service: SelectTransitTrips\n routing: TransitRoutingChange_Routing\n
"},{"location":"datamodels/#projectcard.models.changes.TransitServiceDeletion","title":"TransitServiceDeletion
","text":"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
transit_service_deletion:\n service:\n trip_properties:\n route_short_name: \"green\"\n timespans:\n - ['06:00:00', '09:00:00']\n clean_shapes: false\n clean_routes: true\n
Source code in projectcard/models/changes.py
class TransitServiceDeletion(BaseModel):\n \"\"\"Requirements for describing transit service deletion project card (e.g. to delete).\n\n Attributes:\n service (SelectTransitTrips): Selection of transit trips to delete.\n clean_shapes (Optional[bool]): If True, will clean unused transit shapes associated with the deleted trips\n if they are not otherwise being used. Defaults to False.\n clean_routes (Optional[bool]): If True, will clean unused routes associated with the deleted trips if they\n are not otherwise being used. Defaults to False.\n\n !!! Example \"Example Transit Service Deletion\"\n ```yaml\n transit_service_deletion:\n service:\n trip_properties:\n route_short_name: \"green\"\n timespans:\n - ['06:00:00', '09:00:00']\n clean_shapes: false\n clean_routes: true\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n service: SelectTransitTrips\n clean_shapes: Optional[bool] = False\n clean_routes: Optional[bool] = False\n
"},{"location":"datamodels/#selections","title":"Selections","text":"Data models for selecting nodes, links, and trips in a project card.
"},{"location":"datamodels/#projectcard.models.selections.SelectFacility","title":"SelectFacility
","text":"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
.
facility:\n links:\n name: [\"main\"]\n from:\n osm_node_id: \"1\"\n to:\n osm_node_id: \"2\"\n
Example: Select links between model nodes 4 and 5 along I-95 that are 3 lanes.
facility:\n links:\n ref: [\"I-95\"]\n lanes: [3]\n from:\n model_node_id: 4\n to:\n model_node_id: 5\n
Example: Select all links on SR320 which have 1 or 2 managed lanes.
facility:\n links:\n ref: [\"SR320\"]\n ML_lanes: [1, 2]\n
Source code in projectcard/models/selections.py
class SelectFacility(BaseModel):\n \"\"\"Roadway Facility Selection.\n\n Each selection must have at either: `links`, `nodes`, or `links` and `from` and `to`.\n\n Specifying `links`, `from`, and `to` will attempt to select a continuous path between the\n two nodes which as much as possible follows the initial link selection that is provided\n (e.g. `name`, `osm_link_id`, `model_link_id`, `ref`) using the specified `modes`.\n Secondary selection parameters (e.g. `lanes`, `price`) will be used to filter the\n continuous path - reulting in a final selection of links that may or may not connect\n the two nodes.\n\n Attributes:\n links (Optional[SelectRoadLinks]): Selection of roadway links.\n nodes (Optional[SelectRoadNodes]): Selection of roadway nodes.\n from (Optional[SelectRoadNode]): Selection of the origin node.\n to (Optional[SelectRoadNode]): Selection of the destination node.\n\n !!! Example \"Example: Select all links between osm nodes 1 and 2 along `main`.\"\n ```yaml\n facility:\n links:\n name: [\"main\"]\n from:\n osm_node_id: \"1\"\n to:\n osm_node_id: \"2\"\n ```\n\n !!! Example \"Example: Select links between model nodes 4 and 5 along I-95 that are 3 lanes.\"\n ```yaml\n facility:\n links:\n ref: [\"I-95\"]\n lanes: [3]\n from:\n model_node_id: 4\n to:\n model_node_id: 5\n ```\n\n !!! Example \"Example: Select all links on SR320 which have 1 or 2 managed lanes.\"\n ```yaml\n facility:\n links:\n ref: [\"SR320\"]\n ML_lanes: [1, 2]\n ```\n \"\"\"\n\n require_one_of: ClassVar = [\n [\"links\", \"nodes\", [\"links\", \"from\", \"to\"]],\n ]\n model_config = ConfigDict(extra=\"forbid\")\n\n links: Optional[SelectRoadLinks] = None\n nodes: Optional[SelectRoadNodes] = None\n from_: Annotated[Optional[SelectRoadNode], Field(None, alias=\"from\")]\n to: Optional[SelectRoadNode] = None\n
"},{"location":"datamodels/#projectcard.models.selections.SelectRoadLinks","title":"SelectRoadLinks
","text":"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 ref
which usually refers to a route or exit number. See: https://wiki.openstreetmap.org/wiki/Key:ref. If multiple provided will be treated as an OR condition.
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 \u2018Main St\u2019 or \u2018Broadway\u2019.
links:\n name: [\"Main St\", \"Broadway\"]\n modes: [\"drive\"]\n lanes: [2, 3]\n
Example: Links with model_link_id 12345 or 67890.
links:\n model_link_id: [12345, 67890]\n
Example: Links where biking is allowed but driving is not.
links:\n all: True\n bike_allowed: true\n drive_allowed: false\n
Source code in projectcard/models/selections.py
class SelectRoadLinks(BaseModel):\n \"\"\"Requirements for describing links in the `facility` section of a project card.\n\n Must have one of `all`, `name`, `osm_link_id`, or `model_link_id`.\n Additional fields to select on may be provided and will be treated as an AND condition after\n the primary selection from `all`, `name`, `osm_link_id`, or `model_link_id`.\n\n Attributes:\n all (bool): If True, select all links.\n name (Optional[list[str]]): List of names to select. If multiple provided will\n be treated as an OR condition.\n ref (Optional[list[str]]): Open Street Map `ref` which usually refers to a route\n or exit number. See: <https://wiki.openstreetmap.org/wiki/Key:ref>. If multiple\n provided will be treated as an OR condition.\n osm_link_id (Optional[list[str]]): List of OSM link IDs to select. If multiple provided\n will be treated as an OR condition.\n model_link_id (Optional[list[int]]): List of model link IDs to select. If multiple provided\n will be treated as an OR condition.\n modes (Optional[Modes]): List of modes to select. If multiple provided will be\n treated as an OR condition.\n ignore_missing (bool): If True, ignore missing links. Otherwise, raise an error\n if they are not found. Defaults to True.\n\n !!! Example \"Example: 2 and 3 lane drivable links named 'Main St' or 'Broadway'.\"\n ```yaml\n links:\n name: [\"Main St\", \"Broadway\"]\n modes: [\"drive\"]\n lanes: [2, 3]\n ```\n\n !!! Example \"Example: Links with model_link_id 12345 or 67890.\"\n ```yaml\n links:\n model_link_id: [12345, 67890]\n ```\n\n !!! Example \"Example: Links where biking is allowed but driving is not.\"\n ```yaml\n links:\n all: True\n bike_allowed: true\n drive_allowed: false\n ```\n \"\"\"\n\n require_conflicts: ClassVar = [\n [\"all\", \"osm_link_id\"],\n [\"all\", \"model_link_id\"],\n [\"all\", \"name\"],\n [\"all\", \"ref\"],\n [\"osm_link_id\", \"model_link_id\"],\n [\"osm_link_id\", \"name\"],\n [\"model_link_id\", \"name\"],\n ]\n require_any_of: ClassVar = [[\"name\", \"ref\", \"osm_link_id\", \"model_link_id\", \"all\"]]\n\n model_config = ConfigDict(extra=\"allow\", coerce_numbers_to_str=True)\n\n all: Optional[bool] = False\n name: Annotated[Optional[list[str]], Field(None, min_length=1)]\n ref: Annotated[Optional[list[str]], Field(None, min_length=1)]\n osm_link_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n model_link_id: Annotated[Optional[list[int]], Field(None, min_length=1)]\n modes: Annotated[Optional[list[Mode]], Field(None, min_length=1)]\n ignore_missing: Optional[bool] = True\n\n _examples: ClassVar[list[dict]] = [\n {\"name\": [\"Main St\"], \"modes\": [\"drive\"]},\n {\"osm_link_id\": [\"123456789\"]},\n {\"model_link_id\": [123456789], \"modes\": [\"walk\"]},\n {\"all\": \"True\", \"modes\": [\"transit\"]},\n ]\n
"},{"location":"datamodels/#projectcard.models.selections.SelectRoadNodes","title":"SelectRoadNodes
","text":"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 all
, osm_node_id
or model_node_id
.
osm_node_id
Optional[list[str]]
List of OSM node IDs to select. Must have either all
, osm_node_id
or model_node_id
.
model_node_id
Optional[list[int]]
List of model node IDs to select. Must have either all
, osm_node_id
or model_node_id
.
ignore_missing
bool
If True, ignore missing nodes. Otherwise, raise an error if they are not found. Defaults to True.
Example Roadway Nodes
nodes:\n model_node_id: [12345, 67890]\n
Source code in projectcard/models/selections.py
class SelectRoadNodes(BaseModel):\n \"\"\"Requirements for describing multiple nodes of a project card (e.g. to delete).\n\n Attributes:\n all (bool): If True, select all nodes. Must have either `all`, `osm_node_id` or\n `model_node_id`.\n osm_node_id (Optional[list[str]]): List of OSM node IDs to select. Must have either\n `all`, `osm_node_id` or `model_node_id`.\n model_node_id (Optional[list[int]]): List of model node IDs to select. Must have either\n `all`, `osm_node_id` or `model_node_id`.\n ignore_missing (bool): If True, ignore missing nodes. Otherwise, raise an error\n if they are not found. Defaults to True.\n\n !!! Example \"Example Roadway Nodes\"\n ```yaml\n nodes:\n model_node_id: [12345, 67890]\n ```\n \"\"\"\n\n require_any_of: ClassVar = [[\"osm_node_id\", \"model_node_id\"]]\n model_config = ConfigDict(extra=\"forbid\", coerce_numbers_to_str=True)\n\n all: Optional[bool] = False\n osm_node_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n model_node_id: Annotated[Optional[list[int]], Field(min_length=1)]\n ignore_missing: Optional[bool] = True\n
"},{"location":"datamodels/#projectcard.models.selections.SelectTransitTrips","title":"SelectTransitTrips
","text":"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.
service:\n route_properties:\n route_id: [\"1\", \"2\"]\n timespans:\n - [\"12:00\", \"19:45\"]\n
Example: Select express route trips that goes through nodes 1, 2, and 3.
service:\n route_properties:\n route_short_name: [\"EXP*\"]\n nodes:\n stop_id: [1, 2, 3]\n require: \"all\"\n
Source code in projectcard/models/selections.py
class SelectTransitTrips(BaseModel):\n \"\"\"Selection of transit trips.\n\n Each selection must have at least one of `trip_properties`, `route_properties`, `nodes`,\n or `links`.\n\n Multiple requirements are treated as an AND condition.\n\n Attributes:\n trip_properties (Optional[SelectTripProperties]): Selection based on trip properties.\n route_properties (Optional[SelectRouteProperties]): Selection based on route properties.\n timespans (List[Timespan]): List of timespans to select. Multiple timespans are treated\n as an OR condition.\n nodes (Optional[SelectTransitNodes]): Transit nodes to select. Useful for querying\n stops that might be moved/deleted when a roadway is changed.\n links (Optional[SelectTransitLinks]): Selection of transit links. Useful for querying\n links that might be moved/deleted when a roadway is changed.\n\n !!! Example \"Example: Select trips on route 1 or 2 that run between 12:00 and 19:45.\"\n ```yaml\n service:\n route_properties:\n route_id: [\"1\", \"2\"]\n timespans:\n - [\"12:00\", \"19:45\"]\n ```\n\n !!! Example \"Example: Select express route trips that goes through nodes 1, 2, and 3.\"\n ```yaml\n service:\n route_properties:\n route_short_name: [\"EXP*\"]\n nodes:\n stop_id: [1, 2, 3]\n require: \"all\"\n ```\n \"\"\"\n\n trip_properties: Annotated[Optional[SelectTripProperties], Field(None)]\n route_properties: Annotated[Optional[SelectRouteProperties], Field(None)]\n timespans: Annotated[Optional[list[Timespan]], Field(None, min_length=1)]\n nodes: Annotated[Optional[SelectTransitNodes], Field(None)]\n links: Annotated[Optional[SelectTransitLinks], Field(None)]\n\n model_config = ConfigDict(\n extra=\"forbid\",\n protected_namespaces=(),\n )\n
"},{"location":"datamodels/#supporting-models","title":"Supporting Models","text":"Structures (lists and objects) used in project card models.
"},{"location":"datamodels/#projectcard.models.structs.Dependencies","title":"Dependencies
","text":"Dependencies for a project card.
Source code in projectcard/models/structs.py
class Dependencies(BaseModel):\n \"\"\"Dependencies for a project card.\"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n conflicts: Optional[list[str]]\n prerequisites: Optional[list[str]]\n corequisites: Optional[list[str]]\n _examples: ClassVar[list[dict]] = [\n {\"conflicts\": [\"a\", \"b\"], \"prerequisites\": [\"c\", \"d\"], \"corequisites\": [\"e\", \"f\"]},\n ]\n
"},{"location":"datamodels/#projectcard.models.structs.IndivScopedPropertySetItem","title":"IndivScopedPropertySetItem
","text":"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
scoped:\n- category: hov3\n timespan: ['6:00', '9:00']\n set: 2.0\n- category: hov2\n change: 1\n
Source code in projectcard/models/structs.py
class IndivScopedPropertySetItem(BaseModel):\n \"\"\"Value for setting property value for a single time of day and category.\n\n Must have at least one of `set` or `change`.\n\n Attributes:\n category: Optional[Union[str, int]]: Category for the property change. If not provided,\n the change will be applied to all categories minus any other categories that are\n provided.\n timespan: Optional[Timespan]: Timespan for the property change. If not provided, the\n change will be applied to the entire timespan minus any other timespans that are\n provided.\n set: Optional[Any]: Value to set for the property change.\n existing: Optional[Any]: Existing value for the property change.\n change: Optional[Union[int, float]]: Change value for the property change.\n\n !!! Example \"Example Scoped Property Set\"\n ```yaml\n scoped:\n - category: hov3\n timespan: ['6:00', '9:00']\n set: 2.0\n - category: hov2\n change: 1\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\", exclude_none=True)\n\n category: Optional[Union[str, int]]\n timespan: Optional[Timespan]\n set: Optional[Any] = None\n existing: Optional[Any] = None\n change: Optional[Union[int, float]] = None\n
"},{"location":"datamodels/#projectcard.models.structs.RoadLink","title":"RoadLink
","text":"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\n A: 269066\n B: 268932\n name: new freeway\n roadway: motorway\n lanes: 3\n distance: 0.5\n sc_lanes:\n - timespan: ['6:00', '9:00']\n value: 2\n - timespan: ['9:00', '15:00']\n value: 4\n sc_price:\n - timespan: ['6:00', '9:00']\n value: 2.0\n - timespan: ['9:00', '15:00']\n value: 4.0\n ML_access_point: 'all'\n ML_egress_point: 'all'\n ML_lanes: 1\n sc_ML_lanes:\n - timespan: ['6:00', '9:00']\n value: 2\n - timespan: ['9:00', '15:00']\n value: 4\n sc_ML_price:\n - timespan: ['6:00', '9:00']\n value: 2.0\n - timespan: ['9:00', '15:00']\n value: 4.0\n
Source code in projectcard/models/structs.py
class RoadLink(BaseModel):\n \"\"\"Requirements for describing new roadway links of a project card.\n\n The following fields may NOT be specified in a ProjectCard as they are calculated or managed\n by Wrangler: `model_link_id_idx`, `managed`, `geometry`, `projects`, `ML_geometry`, `ML_A`,\n `ML_B`, `ML_projects`.\n\n Attributes:\n model_link_id: int: Model link ID.\n A: int: `model_node_id` for the A (from) node.\n B: int: `model_node_id` for the B (to) node.\n name: str: Name of the link.\n roadway: OsmRoadwayType: Roadway facility type based on Open Street Map (OSM) roadway types.\n See: <https://wiki.openstreetmap.org/wiki/Key:highway>.\n lanes: int: Number of lanes. Must be greater than or equal to 0.\n price: Optional[float]: Price for the link.\n rail_only: Optional[bool]: True if the link is rail only.\n bus_only: Optional[bool]: True if the link is bus only.\n drive_access: Optional[bool]: True if the link is drive accessible.\n bike_access: Optional[bool]: True if the link is bike accessible.\n walk_access: Optional[bool]: True if the link is walk accessible.\n truck_access: Optional[bool]: True if the link is truck accessible.\n distance: float: Distance of the link in miles. Must be greater than or equal to 0.\n shape_id: Optional[str]: Shape ID for the link used as a foreign key to a\n roadway shape table.\n osm_link_id: Optional[str]: OSM link ID.\n access: Optional[Any]: Access for the link.\n sc_lanes: Optional[list[dict]]: List of values of the lane property as it changes with\n timespans and/or categories (e.g. HOV, truck, etc.).\n sc_price: Optional[list[dict]]: List of values of the price property as it changes with\n timespans and/or categories (e.g. HOV, truck, etc.).\n ML_access_point: Optional[MLAccessEgress]: Access point for parallel managed lanes.\n ML_egress_point: Optional[MLAccessEgress]: Egress point for parallel managed lanes.\n ML_lanes: Optional[int]: Number of lanes for parallel managed lanes. Must be greater than\n or equal to 0.\n ML_price: Optional[float]: Price for parallel managed lanes.\n ML_access: Optional[Any]: Access for parallel managed lanes.\n sc_ML_lanes: Optional[list[dict]]: List of values of the lane property for parallel managed\n lanes as it changes with timespans and/or categories (e.g. HOV, truck, etc.).\n sc_ML_price: Optional[list[dict]]: List of values of the price property for parallel managed\n lanes as it changes with timespans and/or categories (e.g. HOV, truck, etc.).\n\n !!! Example \"Example Roadway Link\"\n ```yaml\n - model_link_id: 404982\n A: 269066\n B: 268932\n name: new freeway\n roadway: motorway\n lanes: 3\n distance: 0.5\n sc_lanes:\n - timespan: ['6:00', '9:00']\n value: 2\n - timespan: ['9:00', '15:00']\n value: 4\n sc_price:\n - timespan: ['6:00', '9:00']\n value: 2.0\n - timespan: ['9:00', '15:00']\n value: 4.0\n ML_access_point: 'all'\n ML_egress_point: 'all'\n ML_lanes: 1\n sc_ML_lanes:\n - timespan: ['6:00', '9:00']\n value: 2\n - timespan: ['9:00', '15:00']\n value: 4\n sc_ML_price:\n - timespan: ['6:00', '9:00']\n value: 2.0\n - timespan: ['9:00', '15:00']\n value: 4.0\n ```\n \"\"\"\n\n model_config = ConfigDict(coerce_numbers_to_str=True)\n PROTECTED_FIELDS: ClassVar = [\n \"model_link_id_idx\",\n \"managed\",\n \"geometry\",\n \"projects\",\n \"ML_geometry\",\n \"ML_A\",\n \"ML_B\",\n \"ML_projects\",\n ]\n model_link_id: int\n A: int\n B: int\n name: str\n roadway: OsmRoadwayType\n lanes: Annotated[int, Field(ge=0)]\n\n # Fields Wrangler has defaults for that are optional to specify in ProjectCard\n price: Optional[float]\n rail_only: Optional[bool]\n bus_only: Optional[bool]\n drive_access: Optional[bool]\n bike_access: Optional[bool]\n walk_access: Optional[bool]\n truck_access: Optional[bool]\n distance: Annotated[float, Field(ge=0)]\n\n # Optional Fields for Wrangler\n shape_id: Optional[str]\n osm_link_id: Optional[str]\n access: Optional[Any]\n sc_lanes: Optional[list[dict]]\n sc_price: Optional[list[dict]]\n\n # Fields for parallel managed lanes properties\n ML_access_point: Optional[MLAccessEgress]\n ML_egress_point: Optional[MLAccessEgress]\n\n ML_lanes: Optional[Annotated[int, Field(0, ge=0)]]\n ML_price: Optional[Annotated[float, Field(0)]]\n ML_access: Optional[Any]\n\n sc_ML_lanes: Optional[list[dict]]\n sc_ML_price: Optional[list[dict]]\n sc_ML_access: Optional[list[dict]]\n ML_shape_id: Optional[str]\n\n @model_validator(mode=\"before\")\n @classmethod\n def check_protected_omitted(cls, data: Any) -> Any:\n \"\"\"Check that protected fields are omitted.\"\"\"\n if isinstance(data, dict):\n protected_present = [k for k in cls.PROTECTED_FIELDS if k in data]\n if protected_present:\n msg = f\"Protected fields {cls.PROTECTED_FIELDS} must be omitted.\"\n CardLogger.error(msg + f\" Found: {protected_present}\")\n raise ValueError(msg)\n return data\n
"},{"location":"datamodels/#projectcard.models.structs.RoadLink.check_protected_omitted","title":"check_protected_omitted(data)
classmethod
","text":"Check that protected fields are omitted.
Source code in projectcard/models/structs.py
@model_validator(mode=\"before\")\n@classmethod\ndef check_protected_omitted(cls, data: Any) -> Any:\n \"\"\"Check that protected fields are omitted.\"\"\"\n if isinstance(data, dict):\n protected_present = [k for k in cls.PROTECTED_FIELDS if k in data]\n if protected_present:\n msg = f\"Protected fields {cls.PROTECTED_FIELDS} must be omitted.\"\n CardLogger.error(msg + f\" Found: {protected_present}\")\n raise ValueError(msg)\n return data\n
"},{"location":"datamodels/#projectcard.models.structs.RoadNode","title":"RoadNode
","text":"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
class RoadNode(BaseModel):\n \"\"\"Requirements for describing new roadway nodes of a project card.\n\n Attributes:\n model_node_id: int: Model node ID.\n X: Longitude: Longitude of the node.\n Y: Latitude: Latitude of the node.\n \"\"\"\n\n model_node_id: int\n X: Longitude\n Y: Latitude\n
"},{"location":"datamodels/#projectcard.models.structs.RoadwayPropertyChange","title":"RoadwayPropertyChange
","text":"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 scoped
is provided, this value will be used as the default value when no scoped value matches. Should not be provided if set
is provided. This value is assumed to be a scalar difference to be applied to the existing value.
set
Optional[Any]
Optional[Any]: Value to set the property to. If scoped
is provided, this value will be used as the default value when no scoped value matches. Should not be provided if change
is provided.
scoped
Optional[Union[None, ScopedPropertySetList]]
Optional[Union[None, ScopedPropertySetList]]: List of values for the property for various category
(e.g. HOV, truck, etc.) and timespan
(e.g. 6:00-9:00, 9:00-15:00) combinations. When provided, the set
(or applied change
) value will be used as the default value when no scoped value matches.
overwrite_scoped
Optional[Literal['conflicting', 'all', 'error']]
Optional[Literal[\u201cconflicting\u201d, \u201call\u201d, \u201cerror\u201d]]: How to handle conflicting scoped property sets. If conflicting
, conflicting scoped property sets will be overwritten. If all
, all existing scoped property sets will be overwritten. If error
, conflicting scoped property sets will raise an error.
existing_value_conflict
Optional[Literal['error', 'warn', 'skip']]
Optional[Literal[\u201cerror\u201d, \u201cwarn\u201d, \u201cskip\u201d]]: How to handle conflicting existing values. If error
, conflicting existing values will raise an error. If warn
, conflicting existing values will raise a warning. If skip
, property change will be skipped.
Example: Reduce lanes by 1\u2026but only if the existing value is 3.
lanes:\n existing: 3\n change: -1\n existing_value_conflict: skip\n
Example: Set Peak Hour tolls for HOV3 and HOV2.
price:\n overwrite_scoped: all\n change: 0\n scoped:\n - category: hov3\n timespan: ['6:00', '9:00']\n set: 2.0\n - category: hov2\n timespan: ['6:00', '9:00']\n set: 3.0\n
Source code in projectcard/models/structs.py
class RoadwayPropertyChange(BaseModel):\n \"\"\"Value for setting a single property value.\n\n Must have at least one of `set` or `change`.\n\n Attributes:\n existing: Optional[Any]: Existing value for the property change. Assumption about the\n existing (default, not scoped) value for this property.\n change: Optional[Union[int, float]]: Change value for the property change. If `scoped` is\n provided, this value will be used as the default value when no scoped value matches.\n Should not be provided if `set` is provided. This value is assumed to be a scalar\n difference to be applied to the existing value.\n set: Optional[Any]: Value to set the property to. If `scoped` is provided, this value\n will be used as the default value when no scoped value matches. Should not be provided\n if `change` is provided.\n scoped: Optional[Union[None, ScopedPropertySetList]]: List of values for the property for\n various `category` (e.g. HOV, truck, etc.) and `timespan` (e.g. 6:00-9:00, 9:00-15:00)\n combinations. When provided, the `set` (or applied `change`) value will be used as\n the default value when no scoped value matches.\n overwrite_scoped: Optional[Literal[\"conflicting\", \"all\", \"error\"]]: How to handle\n conflicting scoped property sets. If `conflicting`, conflicting scoped property sets\n will be overwritten. If `all`, all existing scoped property sets will be\n overwritten. If `error`, conflicting scoped property sets will raise an error.\n existing_value_conflict: Optional[Literal[\"error\", \"warn\", \"skip\"]]: How to handle\n conflicting existing values. If `error`, conflicting existing values will raise an\n error. If `warn`, conflicting existing values will raise a warning. If `skip`,\n property change will be skipped.\n\n !!! Example \"Example: Reduce lanes by 1...but only if the existing value is 3.\"\n ```yaml\n lanes:\n existing: 3\n change: -1\n existing_value_conflict: skip\n ```\n\n !!! Example \"Example: Set Peak Hour tolls for HOV3 and HOV2.\"\n ```yaml\n price:\n overwrite_scoped: all\n change: 0\n scoped:\n - category: hov3\n timespan: ['6:00', '9:00']\n set: 2.0\n - category: hov2\n timespan: ['6:00', '9:00']\n set: 3.0\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\", exclude_none=True)\n\n existing: Optional[Any] = None\n change: Optional[Union[int, float]] = None\n set: Optional[Any] = None\n scoped: Optional[Union[None, ScopedPropertySetList]] = None\n overwrite_scoped: Optional[Literal[\"conflicting\", \"all\", \"error\"]] = None\n existing_value_conflict: Optional[Literal[\"error\", \"warn\", \"skip\"]] = None\n\n require_one_of: ClassVar = [\n [\"change\", \"set\"],\n ]\n
"},{"location":"datamodels/#projectcard.models.structs.SelectRoadNode","title":"SelectRoadNode
","text":"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
.
osm_node_id
Optional[str]
Optional[str]: OSM node ID to select. Must have either this or model_node_id
.
Example: Select roadway node with model node ID 12345.
model_node_id: 12345\n
Source code in projectcard/models/structs.py
class SelectRoadNode(BaseModel):\n \"\"\"Selection of a single roadway node in the `facility` section of a project card.\n\n Additional properties may be used if they are defined in the roadway network node table.\n\n Attributes:\n model_node_id: Optional[int]: Model node ID to select. Must have either this or\n `osm_node_id`.\n osm_node_id: Optional[str]: OSM node ID to select. Must have either this or\n `model_node_id`.\n\n !!! Example \"Example: Select roadway node with model node ID 12345.\"\n ```yaml\n model_node_id: 12345\n ```\n \"\"\"\n\n require_one_of: ClassVar = [[\"osm_node_id\", \"model_node_id\"]]\n model_config = ConfigDict(extra=\"allow\", coerce_numbers_to_str=True)\n\n osm_node_id: Optional[str]\n model_node_id: Optional[int]\n
"},{"location":"datamodels/#projectcard.models.structs.SelectRouteProperties","title":"SelectRouteProperties
","text":"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 \u2018*\u2019 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 \u2018*\u2019 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 \u2018*\u2019 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 \u2018*\u2019 wildcard character.
Source code in projectcard/models/structs.py
class SelectRouteProperties(BaseModel):\n \"\"\"Selection proeprties for transit routes.\n\n Assumed to be an AND condition if more than one property is provided.\n\n Additional properties may be used if they are defined in the transit route table.\n\n Attributes:\n route_short_name: Optional[List[str]: List of Route short names to select. If more than one\n is provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n route_long_name: Optional[List[str]: List of Route long names to select. If more than one\n is provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n agency_id: Optional[List[str]: List of Agency IDs to select. If more than one is provided,\n the selection will be based on an OR condition. Can also select based on a partial match\n using the '*' wildcard character.\n route_type: Optional[List[int]: List of Route types to select. If more than one is provided,\n the selection will be based on an OR condition. Can also select based on a partial match\n using the '*' wildcard character.\n \"\"\"\n\n model_config = ConfigDict(extra=\"allow\", coerce_numbers_to_str=True)\n route_short_name: Annotated[Optional[list[str]], Field(None, min_length=1)]\n route_long_name: Annotated[Optional[list[str]], Field(None, min_length=1)]\n agency_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n route_type: Annotated[Optional[list[int]], Field(None, min_length=1)]\n\n class ConfigDict:\n \"\"\"Config for the model.\"\"\"\n\n protected_namespaces = ()\n
"},{"location":"datamodels/#projectcard.models.structs.SelectRouteProperties.ConfigDict","title":"ConfigDict
","text":"Config for the model.
Source code in projectcard/models/structs.py
class ConfigDict:\n \"\"\"Config for the model.\"\"\"\n\n protected_namespaces = ()\n
"},{"location":"datamodels/#projectcard.models.structs.SelectTransitLinks","title":"SelectTransitLinks
","text":"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 require
attribute. Must be provided if ab_nodes
is not.
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
attribute. Must be provided if model_link_id
is not.
require
Optional[Literal['any', 'all']]
Optional[Literal[\u201cany\u201d, \u201call\u201d]]: 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.
ab_nodes:\n - A: 1\n B: 2\n - A: 3\n B: 4\nrequire: any\n
Example: Select transit trips with links using model link IDs 123 AND 321.
model_link_id: [123, 321]\nrequire: all\n
Source code in projectcard/models/structs.py
class SelectTransitLinks(BaseModel):\n \"\"\"Requirements for describing multiple transit links of a project card.\n\n Attributes:\n model_link_id: Optional[List[int]]: List of model link IDs to select. If more than one is\n provided, the selection will be OR or AND based on the `require` attribute. Must\n be provided if `ab_nodes` is not.\n ab_nodes: Optional[List[TransitABNodes]]: List of AB nodes to select. If more than one is\n provided, the selection will be OR or AND based on the `require` attribute. Must\n be provided if `model_link_id` is not.\n require: Optional[Literal[\"any\", \"all\"]]: Require either any or all of the selected\n links to meet the selection criteria.\n\n !!! Example \"Example: Select transit trips with links using nodes 1-2 OR 3-4.\"\n ```yaml\n ab_nodes:\n - A: 1\n B: 2\n - A: 3\n B: 4\n require: any\n ```\n\n !!! Example \"Example: Select transit trips with links using model link IDs 123 AND 321.\"\n ```yaml\n model_link_id: [123, 321]\n require: all\n ```\n \"\"\"\n\n require_one_of: ClassVar = [\n [\"ab_nodes\", \"model_link_id\"],\n ]\n\n model_link_id: Annotated[Optional[list[int]], Field(min_length=1)]\n ab_nodes: Annotated[Optional[list[TransitABNodes]], Field(min_length=1)]\n require: Optional[Literal[\"any\", \"all\"]]\n\n model_config = ConfigDict(\n extra=\"forbid\",\n protected_namespaces=(),\n )\n _examples: ClassVar[list[dict]] = [\n {\n \"ab_nodes\": [{\"A\": 75520, \"B\": 66380}, {\"A\": 66380, \"B\": 75520}],\n \"type\": \"any\",\n },\n {\n \"model_link_id\": [123, 321],\n \"type\": \"all\",\n },\n ]\n
"},{"location":"datamodels/#projectcard.models.structs.SelectTransitNodes","title":"SelectTransitNodes
","text":"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
attribute.
require
Optional[Literal['any', 'all']]
Optional[Literal[\u201cany\u201d, \u201call\u201d]]: Require either any or all of the selected nodes to meet the selection criteria.
Example: Select transit trips that use model node IDs 1 AND 2.
stop_id: [1, 2]\nrequire: all\n
Source code in projectcard/models/structs.py
class SelectTransitNodes(BaseModel):\n \"\"\"Selecting trips that use transit nodes.\n\n Attributes:\n stop_id: List[int]: List of model node IDs to select. Must have at least one node.\n Multiple nodes are treated as an OR or AND based on the `require` attribute.\n require: Optional[Literal[\"any\", \"all\"]]: Require either any or all of the selected\n nodes to meet the selection criteria.\n\n !!! Example \"Example: Select transit trips that use model node IDs 1 AND 2.\"\n ```yaml\n stop_id: [1, 2]\n require: all\n ```\n \"\"\"\n\n stop_id: Annotated[list[int], Field(min_length=1)]\n require: Optional[Literal[\"any\", \"all\"]] = \"any\"\n\n model_config = ConfigDict(\n extra=\"forbid\",\n )\n
"},{"location":"datamodels/#projectcard.models.structs.SelectTripProperties","title":"SelectTripProperties
","text":"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 \u2018*\u2019 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 \u2018*\u2019 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 \u2018*\u2019 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 \u2018*\u2019 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 \u2018*\u2019 wildcard character.
Source code in projectcard/models/structs.py
class SelectTripProperties(BaseModel):\n \"\"\"Selection properties for transit trips.\n\n Assumed to be an AND condition if more than one property is provided.\n\n Additional properties may be used if they are defined in the transit trip table.\n\n Attributes:\n trip_id: Optional[List[str]: List of Trip IDs to select. If more than one is provided,\n the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n shape_id: Optional[List[str]: List of Shape IDs to select. If more than one is\n provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n direction_id: Optional[Literal[0, 1]]: Direction ID to select.\n service_id: Optional[List[str]: List Service IDs to select. If more than one is\n provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n route_id: Optional[List[str]: List of Route IDs to select. If more than one is\n provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n trip_short_name: Optional[List[str]: List Trip short names to select. If more than one\n is provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n \"\"\"\n\n model_config = ConfigDict(extra=\"allow\", coerce_numbers_to_str=True)\n\n trip_id: Annotated[Optional[list[str]], Field(None, misn_length=1)]\n shape_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n direction_id: Optional[Literal[0, 1]] = None\n service_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n route_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n trip_short_name: Annotated[Optional[list[str]], Field(None, min_length=1)]\n\n class ConfigDict:\n \"\"\"Config for the model.\"\"\"\n\n protected_namespaces = ()\n
"},{"location":"datamodels/#projectcard.models.structs.SelectTripProperties.ConfigDict","title":"ConfigDict
","text":"Config for the model.
Source code in projectcard/models/structs.py
class ConfigDict:\n \"\"\"Config for the model.\"\"\"\n\n protected_namespaces = ()\n
"},{"location":"datamodels/#projectcard.models.structs.TransitABNodes","title":"TransitABNodes
","text":"Single transit link model.
Source code in projectcard/models/structs.py
class TransitABNodes(BaseModel):\n \"\"\"Single transit link model.\"\"\"\n\n A: Optional[int] = None # model_node_id\n B: Optional[int] = None # model_node_id\n\n model_config = ConfigDict(\n extra=\"forbid\",\n )\n
"},{"location":"datamodels/#projectcard.models.structs.TransitPropertyChange_PropertyChanges","title":"TransitPropertyChange_PropertyChanges
","text":"Value for setting a single property value for transit.
Source code in projectcard/models/structs.py
class TransitPropertyChange_PropertyChanges(BaseModel):\n \"\"\"Value for setting a single property value for transit.\"\"\"\n\n model_config = ConfigDict(extra=\"forbid\", exclude_none=True)\n\n existing: Optional[Any] = None\n change: Optional[Union[int, float]] = None\n set: Optional[Any] = None\n existing_value_conflict: Optional[Literal[\"error\", \"warn\", \"skip\"]] = None\n\n require_one_of: ClassVar = [\n [\"change\", \"set\"],\n ]\n
"},{"location":"datamodels/#projectcard.models.structs.TransitRoute","title":"TransitRoute
","text":"Description of a new transit route.
Attributes:
Name Type Description route_id
str
agency_id
str
https://gtfs.org/reference/static/#routes.txt.
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
https://gtfs.org/reference/static/#routes.txt.
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
class TransitRoute(BaseModel):\n \"\"\"Description of a new transit route.\n\n Attributes:\n route_id: str: Route ID for the route.\n agency_id: str: Agency ID for the route. See GTFS for more information:\n <https://gtfs.org/reference/static/#routes.txt>.\n route_short_name: Optional[str]: Route short name for the route. See GTFS for more\n information: <https://gtfs.org/reference/static/#routes.txt>.\n route_long_name: Optional[str]: Route long name for the route. See GTFS for more\n information: <https://gtfs.org/reference/static/#routes.txt>.\n route_type: int: Route type for the route. See GTFS for more information:\n <https://gtfs.org/reference/static/#routes.txt>.\n trips: list[TransitTrip]: List of trips for the route. Must have at least one trip.\n \"\"\"\n\n model_config = ConfigDict(coerce_numbers_to_str=True)\n route_id: str\n agency_id: str\n route_short_name: Optional[str]\n route_long_name: Optional[str]\n route_type: int\n trips: Annotated[list[TransitTrip], Field(min_length=1)]\n
"},{"location":"datamodels/#projectcard.models.structs.TransitRoutingChange_Routing","title":"TransitRoutingChange_Routing
","text":"Value for setting routing change for transit.
Attributes:
Name Type Description existing
list[int]
list[int]: list of model_node_id
for the extent of the existing nodes to change.
set
list[int]
list[int]: list of model_node_id
for the extent of the new nodes to set. Nodes which are negative will be treated as non-stops.
Example: Reroute around node 2.
routing:\n existing: [1, -2, 3]\n set: [1, -4, -5, -6, 3]\n
Source code in projectcard/models/structs.py
class TransitRoutingChange_Routing(BaseModel):\n \"\"\"Value for setting routing change for transit.\n\n Attributes:\n existing: list[int]: list of `model_node_id` for the extent of the existing nodes\n to change.\n set: list[int]: list of `model_node_id` for the extent of the new nodes to set.\n Nodes which are negative will be treated as non-stops.\n\n !!! Example \"Example: Reroute around node 2.\"\n ```yaml\n routing:\n existing: [1, -2, 3]\n set: [1, -4, -5, -6, 3]\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n existing: list[int]\n set: list[int]\n
"},{"location":"datamodels/#projectcard.models.structs.TransitStopProps","title":"TransitStopProps
","text":"Representation of details about a single transit stop for a new route.
Must have at at least either:
stop
-
board
and alight
-
If stop
is True, then board
and alight
are assumed to be True unless otherwise specified.
- If
stop
is False, then board
and alight
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.
Example: Stop with only boarding.
alight: false\nboard: true\n
Example: Stop with no boarding or alighting.
stop: false\n
Example: Stop with boarding and alighting.
stop: true\ntime_to_next_node_sec: 68\n
Source code in projectcard/models/structs.py
class TransitStopProps(BaseModel):\n \"\"\"Representation of details about a single transit stop for a new route.\n\n Must have at at least either:\n\n - `stop`\n - `board` and `alight`\n\n - If `stop` is True, then `board` and `alight` are assumed to be True unless otherwise\n specified.\n - If `stop` is False, then `board` and `alight` are assumed to be False unless otherwise\n specified.\n\n Attributes:\n stop: Optional[bool]: True if the stop is a stop on the route.\n dwell_secs: Optional[PositiveInt]: Dwell time in seconds at the stop.\n time_to_next_node_sec: Optional[PositiveInt]: Time in seconds to the next node.\n board: Optional[bool]: True if the stop is a boarding stop.\n alight: Optional[bool]: True if the stop is an alighting stop.\n\n !!! Example \"Example: Stop with only boarding.\"\n ```yaml\n alight: false\n board: true\n ```\n\n !!! Example \"Example: Stop with no boarding or alighting.\"\n ```yaml\n stop: false\n ```\n\n !!! Example \"Example: Stop with boarding and alighting.\"\n ```yaml\n stop: true\n time_to_next_node_sec: 68\n ```\n \"\"\"\n\n require_one_of: ClassVar = [\n [\"stop\", \"board\"],\n [\"stop\", \"alight\"],\n [\"stop\"],\n [\"board\", \"alight\"],\n ]\n stop: Optional[bool]\n dwell_secs: Optional[PositiveInt]\n time_to_next_node_sec: Optional[PositiveInt]\n board: Optional[bool]\n alight: Optional[bool]\n
"},{"location":"datamodels/#projectcard.models.structs.TransitTrip","title":"TransitTrip
","text":"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: {\"('7:00', '9:00')\": 600}
.
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
- route_id: 1\n service_id: weekday\n trip_headsign: downtown\n trip_short_name: 1\n direction_id: 0\n headway_secs:\n - ('6:00', '12:00'): 600\n - ('12:00', '13:00'): 900\n routing:\n - 1:\n stop: true\n - 2\n - 3\n - 4:\n stop: true\n alight: false\n - 5\n - 6:\n stop: true\n
Source code in projectcard/models/structs.py
class TransitTrip(BaseModel):\n \"\"\"Description of a new transit trip.\n\n Additional properties may be used so long as they do not conflict with the fields:\n `trip_id`, `shape_id`, and `route_id`. `route_id` is provided at the route-level and\n `trip_id`, `shape_id` are managed by Wrangler in order to ensure primary and foreign\n key constraints are met.\n\n Attributes:\n headway_secs: list[TransitHeadways]: List of headways for the trip - each of which is a\n dictionary of a single timespans and headway value. Must have at least one headway.\n Example: `{\"('7:00', '9:00')\": 600}`.\n routing: TransitRouting: Routing for the trip which is a list of nodes or detailed\n stop properties.\n service_id: Optional[str]: Service ID for the trip. See GTFS for more information:\n <https://gtfs.org/reference/static/#trips.txt>.\n trip_headsign: Optional[str]: Trip headsign. See GTFS for more information:\n <https://gtfs.org/reference/static/#trips.txt>.\n trip_short_name: Optional[str]: Trip short name. See GTFS for more information:\n <https://gtfs.org/reference/static/#trips.txt>.\n direction_id: Optional[int]: Direction ID for the trip. Must be either 0 or 1. See\n GTFS for more information: <https://gtfs.org/reference/static/#trips.txt>.\n\n !!! Example \"Example: New Transit Trip\"\n ```yaml\n - route_id: 1\n service_id: weekday\n trip_headsign: downtown\n trip_short_name: 1\n direction_id: 0\n headway_secs:\n - ('6:00', '12:00'): 600\n - ('12:00', '13:00'): 900\n routing:\n - 1:\n stop: true\n - 2\n - 3\n - 4:\n stop: true\n alight: false\n - 5\n - 6:\n stop: true\n ```\n \"\"\"\n\n model_config = ConfigDict(coerce_numbers_to_str=True)\n PROTECTED_FIELDS: ClassVar = [\"trip_id\", \"shape_id\", \"route_id\"]\n headway_secs: Annotated[list[TransitHeadways], Field(min_length=1)]\n routing: TransitRouting\n service_id: Optional[str]\n trip_headsign: Optional[str]\n trip_short_name: Optional[str]\n direction_id: Optional[int]\n
"},{"location":"datamodels/#supporting-types","title":"Supporting Types","text":"Field types for the projectcard models.
"},{"location":"datamodels/#projectcard.models.fields.MLAccessEgress","title":"MLAccessEgress = Union[Literal['all'], list[int]]
module-attribute
","text":"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.
"},{"location":"datamodels/#projectcard.models.fields.Mode","title":"Mode = Literal['drive', 'walk', 'bike', 'transit', 'any']
module-attribute
","text":"Which modes are searched for. If any
is specified, all modes are searched for.
"},{"location":"datamodels/#projectcard.models.fields.OsmRoadwayType","title":"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
","text":"Open Street Map Roadway Types. See: https://wiki.openstreetmap.org/wiki/Key:highway.
"},{"location":"datamodels/#projectcard.models.fields.TimeString","title":"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
","text":"A HH:MM or HH:MM:SS time string. Example: \"23:44\"
.
"},{"location":"datamodels/#projectcard.models.fields.Timespan","title":"Timespan = Annotated[list[TimeString], Field(examples=[['12:00', '19:45:00']], max_length=2, min_length=2)]
module-attribute
","text":"A list of two time strings representing a start and end time for a time span. Example: [\"12:00\", \"19:45:00\"]
.
"},{"location":"development/","title":"Development","text":""},{"location":"development/#development-environment","title":"Development Environment","text":"If you plan on developing and changing code within the projectcard
project, you will likely want to set up your own development environment from a cloned fork.
Helpful prerequisites:
- github desktop
- conda
- VS Code (or another IDE)
Fork and Install:
-
Fork and clone repo locally
gh cligithub ux gh repo fork network-wrangler/projectcard --clone=true\ncd projectcard\ngit remote add upstream https://github.com/network-wrangler/projectcard.git\n
- In browser, fork the repository to your github account: https://github.com/network-wrangler/projectcard/fork.
- In the browser with your new fork, click green
code
botton and clone to local disk using Github Desktop. - Add the original repo to your upstream remotes to be able to track changes:
- Make sure the cloned repository is open in GitHub Desktop
- Click on
Repository
in the menu bar - Select Open in Terminal (or Open in Git Bash on Windows).
- In the terminal window that opens, enter the following command to add the original repository as a remote named upstream:
git remote add upstream https://github.com/network-wrangler/projectcard.git\n
-
Install dependencies
conda (recommended)pip conda install --yes --file requirements.txt\n
pip install -r requirements.txt\n
-
Install from working directory
pip install -e .\n
"},{"location":"development/#keeping-your-fork-updated","title":"Keeping your fork updated","text":"To make sure any development and work you are doing takes advantage of and is compatable with the main projectcard repository, you will want to fetch and merge updates.
Using Github DesktopIn terminal Click on Fetch origin in the top bar of GitHub Desktop to fetch the latest changes from your fork.
Open the repository in the terminal and run the following command to fetch updates from the upstream repository and merge the udpates into your local branch.
git fetch upstream\ngit merge upstream/main\n
Replace main with the branch of the repository you want to develop towards if it is different.
"},{"location":"development/#style-guide","title":"Style Guide","text":" - All public modules and functions should be documented using google-style docstrings.
- Public modules should be documented with usage examples.
- Public functions should be covered by a test, located in the
/tests
folder. - Code should be formatted per the
ruff
implementation of PEP8 (which is like black
, but faster) - Line width should be no more than 99 characters.
- Document function signatures with type annotations and pass inspection with
mypy
To make sure your code conforms to our style \u2013 ensuring that all differences are meaningful and not just fommatting \u2013 please use pre-commit
before submitting any pull-requests to the main repository:
pre-commit run --all-files\n
This will make sure your code conforms to our guidelines as defined in pyproject.toml
.
"},{"location":"development/#contributing","title":"Contributing","text":"Generally we are happy to accept pull-requests directly to the main
branch which improve documentation or make very minor changes. If you are making more significant changes, please:
"},{"location":"development/#before-starting","title":"Before starting","text":" - Create an issue describing the problem you ar solving: Make sure people know what you are working on and that they can let you know sooner rather than later about their opinions (or assign yourself an existing issue).
"},{"location":"development/#developing","title":"Developing","text":" - Follow the style guide
- Regularly update your fork with upstream changes
"},{"location":"development/#incorporating-code-to-main-projectcard-repository","title":"Incorporating Code to main ProjectCard Repository","text":" - Make sure your code passes all tests
- If you updated documentation, make [sure it properly builds].
- Run
pre-commit
- Submit a pull-request to the main project card repository and thoroughly describe the problem you are trying to solve, referencing the issue it addresses
- Respond to requests from the code reviewer
"},{"location":"development/#documentation","title":"Documentation","text":"Documentation is maintained in the /docs
repository in markdown text files and is built using the mkdocs
package. Public documentation is built using a Github Workflow (.github/workflows/push.yml
) and published using mike
to Github Pages.
"},{"location":"development/#build-the-documentation-locally","title":"Build the documentation locally","text":"This is useful to make sure that changes you made are rendered as you would expect them.
install documentation dependenciespip -r docs/requirements.txt\n
building documentation locallymkdocs serve\n
"},{"location":"development/#releases","title":"Releases","text":" - Releases follow semantic versioning.
- Releases are triggered by project management team via the github \u201creleases\u201d interface.
- Creating a release in github will trigger a github action to send it to
pypi
so that users installing it via pip
will have access to it.
Tip
Releases must have a unique version number in order to be updated on pypi.
"},{"location":"development/#changelog","title":"Changelog","text":"Notable changes and version history.
Version Date Comment v0.3.1 2024-10-07 Improved resilience of read_cards()
including ability to handle relative paths. v0.3.0 2024-09-27 Added transit addition and deletion change types. v0.2.0 2024-09-08 Read cards from nested folders. v0.1.2 2024-08-05 - v0.1.1 2024-06-20 Initial release on PyPI"},{"location":"examples/","title":"Example Data","text":"Example data can be found in the /examples
directory.
Name Category Notes Blue Line Service Enhancement A Transit Property Change changes headway for a single trip during the morning peak Remove Am Service On The Green Line Transit Service Deletion Convert Intersection To Interchange Multiple: Roadway Addition, Roadway Deletion demonstrates how to nest multiple changes into a single project under changes
Example Calculate Mega Freeways Pycode Example Delete Roadway Roadway Deletion simple roadway deletion Example Property Change For All Links Roadway Property Change Reduce lanes and add separated bike facility for all drive links with two lanes and bicycle facility of 0,2, or 3 Example Roadway Add Roadway Addition Simple project card to add new roadway Bus Resign Transit Property Change Change Node X Value Location Roadway Property Change Bus Reroute Transit Routing Change re-routes a bus route to avoid construction Example Add Simple Managed Lane Project Roadway Property Change Simple managed lane project with AM and PM lanes are tolled based on occupancy Example Roadway Addition And Deletion Multiple: Roadway Addition, Roadway Deletion project card with multiple category of add and delete changes Example I394 Parallel Lanes Roadway Property Change demonstrates how to add managed lanes to an existing roadway with restricted access New Green Transit Transit Route Addition Example Property Change Roadway Property Change Simple road diet"},{"location":"examples/#cards","title":"Cards","text":""},{"location":"examples/#blue-line-service-enhancement-a","title":"Blue Line Service Enhancement A","text":"Category: Transit Property Change examples/transit-property-change.yml
project: Blue Line Service Enhancement A\nnotes: changes headway for a single trip during the morning peak\ntags:\n - example\ntransit_property_change:\n service:\n trip_properties:\n trip_id:\n - 14940701-JUN19-MVS-BUS-Weekday-01\n timespans:\n - ['06:00:00', '09:00:00']\n property_changes:\n headway_secs:\n set: 900\n
"},{"location":"examples/#remove-am-service-on-the-green-line","title":"Remove Am Service On The Green Line","text":"Category: Transit Service Deletion examples/transit-service_deletion.yml
project: Remove AM service on the Green Line\ntransit_service_deletion:\n service:\n trip_properties:\n route_short_name: \"green\"\n timespans:\n - ['06:00:00', '09:00:00']\n clean_shapes: false\n clean_routes: true\n
"},{"location":"examples/#convert-intersection-to-interchange","title":"Convert Intersection To Interchange","text":"Category: Multiple: Roadway Addition, Roadway Deletion examples/roadway-add-interchange.yml
project: convert intersection to interchange\nnotes: demonstrates how to nest multiple changes into a single project under `changes`\nchanges:\n- roadway_deletion:\n links:\n model_link_id:\n - 2171\n - 25856\n - 383747\n - 383790\n- roadway_addition:\n links:\n - A: 354386\n name: interchange ramp\n roadway: motorway_link\n B: 16214\n distance : 0.13201\n lanes: 1\n model_link_id: 2171\n bus_only: 0\n rail_only: 0\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 16214\n name: interchange ramp\n roadway: motorway_link\n B: 354386\n distance: 0.13201\n lanes: 1\n model_link_id: 25856\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 4336\n name: interchange ramp\n roadway: motorway_link\n B: 354387\n distance: 0.14848\n lanes: 1\n model_link_id: 2171\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354387\n name: interchange ramp\n roadway: motorway_link\n B: 354386\n distance: 0.10981\n lanes: 1\n model_link_id: 2171\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354386\n name: interchange ramp\n roadway: motorway_link\n B: 354387\n distance: 0.10981\n lanes: 1\n model_link_id: 25856\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354387\n name: interchange ramp\n roadway: motorway_link\n B: 4336\n distance: 0.14848\n lanes: 1\n model_link_id: 25856\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354388\n name: interchange ramp\n roadway: motorway_link\n B: 13931\n distance: 0.55987\n lanes: 2\n model_link_id: 383747\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 12590\n name: interchange ramp\n roadway: motorway_link\n count_AM: 0\n B: 354389\n distance: 0.15228\n lanes: 2\n model_link_id: 383747\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354389\n name: interchange ramp\n roadway: motorway_link\n B: 354388\n distance: 0.16071\n lanes: 2\n model_link_id: 383747\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 12655\n name: interchange ramp\n roadway: motorway_link\n B: 354390\n distance: 0.21899\n lanes: 3\n model_link_id: 383790\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354390\n name: interchange ramp\n roadway: motorway_link\n B: 354391\n distance: 0.21108\n lanes: 3\n model_link_id: 383790\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354391\n B: 14248\n name: interchange ramp\n roadway: motorway_link\n distance: 0.36316\n lanes: 3\n model_link_id: 383790\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354387\n name: interchange ramp\n roadway: motorway_link\n B: 354388\n distance: 0.09188\n lanes: 2\n model_link_id: 384040\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354390\n name: interchange ramp\n roadway: motorway_link\n B: 354386\n distance: 0.12286\n lanes: 2\n model_link_id: 384040\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354386\n name: interchange ramp\n roadway: motorway_link\n B: 354391\n distance: 0.08689\n lanes: 2\n model_link_id: 384040\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354389\n B: 354387\n name: interchange ramp\n roadway: motorway_link\n distance: 0.09431\n lanes: 2\n model_link_id: 384040\n bike_access: 0\n drive_access: 1\n walk_access: 0\n nodes:\n - X: -93.14412\n Y: 44.87497\n model_node_id: 354386\n - X: -93.14189\n Y: 44.87499\n model_node_id: 354387\n - X: -93.14239\n Y: 44.87644\n model_node_id: 354388\n - X: -93.14322\n Y: 44.87414\n model_node_id: 354389\n - X: -93.14273\n Y: 44.87648\n model_node_id: 354390\n - X: -93.14382\n Y: 44.87355\n model_node_id: 354391\n
"},{"location":"examples/#example-calculate-mega-freeways","title":"Example Calculate Mega Freeways","text":"Category: Pycode examples/roadway-calculated.wr
---\nproject: example calculate mega freeways\nself_obj_type: RoadwayNetwork\n---\n\nself.links_df.loc[self.links_df['lanes'] == 4, 'lanes'] = 12\n
"},{"location":"examples/#example-delete-roadway","title":"Example Delete Roadway","text":"Category: Roadway Deletion examples/roadway-delete.yml
project: example delete roadway\nnotes: simple roadway deletion\ntags:\n - 'delete roadway'\n - 'example'\nroadway_deletion:\n links:\n model_link_id:\n - 281\n - 477533\n nodes:\n model_node_id:\n - 314159\n
"},{"location":"examples/#example-property-change-for-all-links","title":"Example Property Change For All Links","text":"Category: Roadway Property Change examples/roadway-property-change-all.yml
project: Example property change for all links\ntags:\n - 'example'\nroadway_property_change:\n facility:\n links:\n modes: ['drive']\n all: 'True'\n lanes: 2\n bicycle_facility: [0,2,3]\n property_changes:\n lanes:\n set: 1\n bicycle_facility:\n set: 1\nnotes: Reduce lanes and add separated bike facility for all drive links with two lanes and bicycle facility of 0,2, or 3\n
"},{"location":"examples/#example-roadway-add","title":"Example Roadway Add","text":"Category: Roadway Addition examples/roadway-add.yml
project: example roadway add\nnotes: Simple project card to add new roadway\ntags:\n - 'add roadway'\n - 'example'\nroadway_addition:\n links:\n - A: 269066\n B: 268932\n name: new neighborhood st\n bike_access: 1\n drive_access: 0\n bus_only: 0\n rail_only: 0\n walk_access: 1\n roadway: residential\n lanes: 1\n model_link_id: 404982\n - A: 268932\n B: 269066\n bike_access: 1\n name: new neighborhood st\n drive_access: 0\n bus_only: 0\n rail_only: 0\n walk_access: 1\n roadway: residential\n lanes: 1\n model_link_id: 407042\n
"},{"location":"examples/#bus-resign","title":"Bus Resign","text":"Category: Transit Property Change examples/transit-node-selection.yml
project: Bus resign\ntags:\n - existing_plus_committed\ntransit_property_change:\n service:\n trip_properties:\n route_id:\n - \"294-111\"\n nodes:\n model_node_id:\n - 37582\n - 37574\n require: \"any\"\n property_changes:\n trip_headsign:\n change: \" thru Union Station\"\n
"},{"location":"examples/#change-node-x-value-location","title":"Change Node X Value Location","text":"Category: Roadway Property Change examples/roadway-node-property-change.yml
project: Change node X value location\nroadway_property_change:\n facility:\n nodes:\n model_node_id: [1234]\n property_changes:\n X:\n set: 1.0\n
"},{"location":"examples/#bus-reroute","title":"Bus Reroute","text":"Category: Transit Routing Change examples/transit-shape-change.yml
project: Bus Reroute\nnotes: re-routes a bus route to avoid construction\ntags:\n - existing_plus_committed\ntransit_routing_change:\n service:\n trip_properties:\n route_id:\n - 294-111\n direction_id: 1\n routing:\n existing:\n - -37582\n - -37574\n - -4761\n - -4763\n - -4764\n - -98429\n - 45985\n - -57483\n - -126324\n - -57484\n - 150855\n - -11188\n - 84899\n - 46666\n - -77077\n set:\n - -37582\n - -37574\n - -4761\n - -4763\n - -4764\n - -98429\n - 45985\n - -57483\n - -126324\n - -57484\n - 150855\n - -11188\n - 84899\n - 46666\n - -46665\n - -46663\n - -81820\n - -76167\n - -77077\n
"},{"location":"examples/#example-add-simple-managed-lane-project","title":"Example Add Simple Managed Lane Project","text":"Category: Roadway Property Change examples/roadway-add-managed-lane-simple.yml
project: example add simple managed lane project\nnotes: Simple managed lane project with AM and PM lanes are tolled based on occupancy\ntags:\n - 'example'\n - 'managed'\nroadway_property_change:\n facility:\n links:\n name:\n - 'I 35E'\n from:\n osm_node_id: '961117623'\n to:\n osm_node_id: '2564047368'\n property_changes:\n segment_id:\n set: 35EHOT-A\n lanes:\n set: 3\n scoped:\n - timespan: ['6:00', '9:00']\n set: 2\n - timespan: ['16:00', '19:00']\n set: 2\n ML_lanes:\n set: 0\n scoped:\n - timespan: ['6:00', '9:00']\n set: 1\n - timespan: ['16:00', '19:00']\n set: 1\n ML_price:\n set: 0\n overwrite_scoped: \"all\"\n scoped:\n - timespan: ['6:00', '9:00']\n category: ['sov']\n set: 1.5\n - timespan: ['16:00', '19:00']\n category: ['sov']\n set: 2.5\n - timespan: ['6:00', '9:00']\n category: ['hov2']\n set: 1.0\n - timespan: ['16:00', '19:00']\n category: ['hov2']\n set: 2.0\n ML_access_point:\n set: 'all'\n ML_egress_point:\n set: 'all'\n
"},{"location":"examples/#example-roadway-addition-and-deletion","title":"Example Roadway Addition And Deletion","text":"Category: Multiple: Roadway Addition, Roadway Deletion examples/roadway-add-delete.yml
project: example roadway addition and deletion\ntags:\n - 'add and delete roadway'\nchanges:\n - roadway_addition:\n nodes:\n - model_node_id: 314159\n X: -93.18389\n Y: 44.96898\n drive_node: 1\n walk_node: 0\n bike_node: 0\n transit_node: 1\n - roadway_deletion:\n links:\n model_link_id:\n - 281\n - 477533\n nodes:\n model_node_id:\n - 314159\n - roadway_addition:\n links:\n - A: 3230\n B: 3262\n model_link_id: 999998\n trn_priority: 0\n lanes: 1\n name: new bike greenway and neighborhood st\n bike_facility: 3\n drive_access: 1\n walk_access: 1\n bike_access: 1\n bus_only: 0\n rail_only: 0\n roadway: residential\n distance: 0.10462\n ttime_assert: 0.0\n OPERATION_final: A\n - A: 3262\n B: 3230\n model_link_id: 999997\n trn_priority: 0\n lanes: 1\n name: new bike greenway and neighborhood st\n bike_facility: 3\n drive_access: 1\n walk_access: 1\n bike_access: 1\n bus_only: 0\n rail_only: 0\n roadway: residential\n distance: 0.10462\n ttime_assert: 0.0\n OPERATION_final: A\n nodes:\n - model_node_id: 354388\n X: -93.18389\n Y: 44.96898\n drive_node: 1\n walk_node: 0\n bike_node: 0\n transit_node: 1\nnotes: project card with multiple category of add and delete changes\n
"},{"location":"examples/#example-i394-parallel-lanes","title":"Example I394 Parallel Lanes","text":"Category: Roadway Property Change examples/roadway-add-managed-lane-restricted-access.yml
project: Example I394 Parallel Lanes\ntags: ['managed lanes']\nnotes: demonstrates how to add managed lanes to an existing roadway with restricted access\nroadway_property_change:\n facility:\n links:\n model_link_id:\n - 390239\n - 391206\n - 390344\n - 401484\n property_changes:\n ML_lanes:\n set: 0\n scoped:\n - timespan: ['6:00', '9:00']\n set: 1\n overwrite_conflicts: true\n - timespan: ['15:00', '18:00']\n set: 1\n lanes:\n change: 0\n scoped:\n - timespan: ['6:00', '9:00']\n change: -1\n - timespan: ['15:00', '18:00']\n change: -1\n segment_id:\n set: 5\n ML_HOV:\n set: 5\n HOV:\n set: 5\n ML_access_point:\n set: [38765, 87982]\n ML_egress_point:\n set: [87993, 37457]\n
"},{"location":"examples/#new-green-transit","title":"New Green Transit","text":"Category: Transit Route Addition examples/transit-route_addition.yml
project: New Green Transit\ntags:\n - new transit\ntransit_route_addition:\n routes:\n - route_id: abc\n route_long_name: green_line\n route_short_name: green\n route_type: 3\n agency_id: The Bus\n trips:\n - direction_id: 0\n headway_secs:\n - ('6:00','12:00'): 600\n - ('12:00','13:00'): 900\n routing:\n - 1:\n stop: true #when stop is set to True, defaults to allow both boarding and alighting\n - 2\n - 3\n - 4:\n stop: true # default to False, specify only when stopping\n alight: false # default to True, specify only when not default\n - 5\n - 6:\n stop: true\n - direction_id: 1\n headway_secs:\n - ('6:00','12:00'): 600\n - ('12:00','13:00'): 900\n routing:\n - 6:\n stop: true\n - 5:\n stop: true\n dwell_sec: 30\n - 4:\n stop: true\n - 6\n - 3:\n time_to_next_node_sec: 90\n - 2:\n stop: true\n - 1:\n stop: true\n
"},{"location":"examples/#example-property-change","title":"Example Property Change","text":"Category: Roadway Property Change examples/roadway-property-change.yml
project: Example property change\ntags:\n - 'example'\nroadway_property_change:\n facility:\n links:\n modes: ['drive','bike']\n osm_link_id:\n - '1234'\n - '2345'\n from:\n osm_node_id: '4321'\n to:\n osm_node_id: '4322'\n property_changes:\n lanes:\n existing: 3\n change: -1\n existing_value_conflict: error\n bicycle_facility:\n existing: 1\n set: 3\n existing_value_conflict: skip\nnotes: Simple road diet\n
"},{"location":"json-schemas/","title":"Schema Documentation","text":"Find this documentation confusing?
Me too. That\u2019s why we spent a bunch more time documenting the data models, which read much more nicely - or you can check out the examples.
/
"},{"location":"json-schemas/#projectcardjson","title":"projectcard.json","text":"Type: Object
Additional Information:
title: Project Card Schema
Definitions:
Definition Type Description Restrictions change_roadway_deletion
changes/roadway_deletion.json
- change_roadway_addition
changes/roadway_addition.json
- change_roadway_property_change
changes/roadway_property_change.json
- transit_property_change
changes/transit_property_change.json
- transit_routing_change
changes/transit_routing_change.json
- transit_route_addition
changes/transit_route_addition.json
- transit_service_deletion
changes/transit_service_deletion.json
- pycode
string
- change
object
- One Of:- {\u201crequired\u201d: [\u201croadway_deletion\u201d]}
- {\u201crequired\u201d: [\u201croadway_addition\u201d]}
- {\u201crequired\u201d: [\u201croadway_property_change\u201d]}
- {\u201crequired\u201d: [\u201ctransit_property_change\u201d]}
- {\u201crequired\u201d: [\u201ctransit_routing_change\u201d]}
- {\u201crequired\u201d: [\u201ctransit_route_addition\u201d]}
- {\u201crequired\u201d: [\u201ctransit_service_deletion\u201d]}
- {\u201crequired\u201d: [\u201cpycode\u201d]}
Properties:
Property Type Description Restrictions $schema
string
Reference to the project card schema which this file uses. If not specified, will be assumed to be the most recent release. project
string
A project name which uniquely identifies this project dependencies
defs/dependencies.json
- tags
defs/tags.json
- roadway_deletion
#/$defs/change_roadway_deletion
- roadway_addition
#/$defs/change_roadway_addition
- roadway_property_change
#/$defs/change_roadway_property_change
- roadway_managed_lanes
#/$defs/change_roadway_property_change
- transit_property_change
#/$defs/transit_property_change
- transit_routing_change
#/$defs/transit_routing_change
- transit_route_addition
#/$defs/transit_route_addition
- transit_service_deletion
#/$defs/transit_service_deletion
- pycode
#/$defs/pycode
- changes
array
of Any
items. - self_obj_type
string
For calculated project cards, must refer to the object to perform the calculation on. Enumeration: RoadwayNetwork
,TransitNetwork
notes
string
- Required:
- \u201cproject\u201d
One Of:- {\u201crequired\u201d: [\u201croadway_deletion\u201d]}
- {\u201crequired\u201d: [\u201croadway_addition\u201d]}
- {\u201crequired\u201d: [\u201croadway_property_change\u201d]}
- {\u201crequired\u201d: [\u201croadway_managed_lanes\u201d]}
- {\u201crequired\u201d: [\u201ctransit_property_change\u201d]}
- {\u201crequired\u201d: [\u201ctransit_routing_change\u201d]}
- {\u201crequired\u201d: [\u201ctransit_route_addition\u201d]}
- {\u201crequired\u201d: [\u201ctransit_service_deletion\u201d]}
- {\u201crequired\u201d: [\u201cpycode\u201d]}
- {\u201crequired\u201d: [\u201cchanges\u201d]}
Project Card Schema Contents
{\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"object\",\n \"$defs\": {\n \"change_roadway_deletion\": {\n \"$ref\": \"changes/roadway_deletion.json\"\n },\n \"change_roadway_addition\": {\n \"$ref\": \"changes/roadway_addition.json\"\n },\n \"change_roadway_property_change\": {\n \"$ref\": \"changes/roadway_property_change.json\"\n },\n \"transit_property_change\": {\n \"$ref\": \"changes/transit_property_change.json\"\n },\n \"transit_routing_change\": {\n \"$ref\": \"changes/transit_routing_change.json\"\n },\n \"transit_route_addition\": {\n \"$ref\": \"changes/transit_route_addition.json\"\n },\n \"transit_service_deletion\": {\n \"$ref\": \"changes/transit_service_deletion.json\"\n },\n \"pycode\": {\n \"type\": \"string\"\n },\n \"change\": {\n \"type\": \"object\",\n \"properties\": {\n \"roadway_deletion\": {\n \"$ref\": \"#/$defs/change_roadway_deletion\"\n },\n \"roadway_addition\": {\n \"$ref\": \"#/$defs/change_roadway_addition\"\n },\n \"roadway_property_change\": {\n \"$ref\": \"#/$defs/change_roadway_property_change\"\n },\n \"transit_property_change\": {\n \"$ref\": \"#/$defs/transit_property_change\"\n },\n \"transit_routing_change\": {\n \"$ref\": \"#/$defs/transit_routing_change\"\n },\n \"transit_route_addition\": {\n \"$ref\": \"#/$defs/transit_route_addition\"\n },\n \"transit_service_deletion\": {\n \"$ref\": \"#/$defs/transit_service_deletion\"\n },\n \"pycode\": {\n \"$ref\": \"#/$defs/pycode\"\n }\n },\n \"oneOf\": [\n {\n \"required\": [\n \"roadway_deletion\"\n ]\n },\n {\n \"required\": [\n \"roadway_addition\"\n ]\n },\n {\n \"required\": [\n \"roadway_property_change\"\n ]\n },\n {\n \"required\": [\n \"transit_property_change\"\n ]\n },\n {\n \"required\": [\n \"transit_routing_change\"\n ]\n },\n {\n \"required\": [\n \"transit_route_addition\"\n ]\n },\n {\n \"required\": [\n \"transit_service_deletion\"\n ]\n },\n {\n \"required\": [\n \"pycode\"\n ]\n }\n ]\n }\n },\n \"title\": \"Project Card Schema\",\n \"required\": [\n \"project\"\n ],\n \"oneOf\": [\n {\n \"required\": [\n \"roadway_deletion\"\n ]\n },\n {\n \"required\": [\n \"roadway_addition\"\n ]\n },\n {\n \"required\": [\n \"roadway_property_change\"\n ]\n },\n {\n \"required\": [\n \"roadway_managed_lanes\"\n ]\n },\n {\n \"required\": [\n \"transit_property_change\"\n ]\n },\n {\n \"required\": [\n \"transit_routing_change\"\n ]\n },\n {\n \"required\": [\n \"transit_route_addition\"\n ]\n },\n {\n \"required\": [\n \"transit_service_deletion\"\n ]\n },\n {\n \"required\": [\n \"pycode\"\n ]\n },\n {\n \"required\": [\n \"changes\"\n ]\n }\n ],\n \"properties\": {\n \"$schema\": {\n \"type\": \"string\",\n \"description\": \"Reference to the project card schema which this file uses. If not specified, will be assumed to be the most recent release.\"\n },\n \"project\": {\n \"type\": \"string\",\n \"description\": \"A project name which uniquely identifies this project\"\n },\n \"dependencies\": {\n \"$ref\": \"defs/dependencies.json\"\n },\n \"tags\": {\n \"$ref\": \"defs/tags.json\"\n },\n \"roadway_deletion\": {\n \"$ref\": \"#/$defs/change_roadway_deletion\"\n },\n \"roadway_addition\": {\n \"$ref\": \"#/$defs/change_roadway_addition\"\n },\n \"roadway_property_change\": {\n \"$ref\": \"#/$defs/change_roadway_property_change\"\n },\n \"roadway_managed_lanes\": {\n \"$ref\": \"#/$defs/change_roadway_property_change\"\n },\n \"transit_property_change\": {\n \"$ref\": \"#/$defs/transit_property_change\"\n },\n \"transit_routing_change\": {\n \"$ref\": \"#/$defs/transit_routing_change\"\n },\n \"transit_route_addition\": {\n \"$ref\": \"#/$defs/transit_route_addition\"\n },\n \"transit_service_deletion\": {\n \"$ref\": \"#/$defs/transit_service_deletion\"\n },\n \"pycode\": {\n \"$ref\": \"#/$defs/pycode\"\n },\n \"changes\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/change\"\n }\n },\n \"self_obj_type\": {\n \"type\": \"string\",\n \"enum\": [\n \"RoadwayNetwork\",\n \"TransitNetwork\"\n ],\n \"description\": \"For calculated project cards, must refer to the object to perform the calculation on. \"\n },\n \"notes\": {\n \"type\": \"string\"\n }\n }\n}\n
"},{"location":"json-schemas/#changestransit_routing_changejson","title":"changes.transit_routing_change.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions service
../transit/selection/select_trips.json
- routing
object
- Required: - \"set\"
Required:
- \u201cservice\u201d
- \u201crouting\u201d
transit_routing_change
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"required\": [\n \"service\",\n \"routing\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"service\": {\n \"$ref\": \"../transit/selection/select_trips.json\"\n },\n \"routing\": {\n \"type\": \"object\",\n \"required\": [\n \"set\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"existing\": {\n \"type\": \"array\"\n },\n \"set\": {\n \"type\": \"array\"\n }\n }\n }\n }\n}\n
"},{"location":"json-schemas/#changestransit_property_changejson","title":"changes.transit_property_change.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions service
../transit/selection/select_trips.json
- property_changes
object
- Required:
- \u201cservice\u201d
- \u201cproperty_changes\u201d
transit_property_change
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"required\": [\n \"service\",\n \"property_changes\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"service\": {\n \"$ref\": \"../transit/selection/select_trips.json\"\n },\n \"property_changes\": {\n \"type\": \"object\",\n \"minItems\": 1,\n \"patternProperties\": {\n \".*\": {\n \"$ref\": \"defs/property_set.json\"\n }\n }\n }\n }\n}\n
"},{"location":"json-schemas/#changesroadway_property_changejson","title":"changes.roadway_property_change.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions facility
../roadway/selection/select_segment.json
- property_changes
object
- Any Of: - {\"patternProperties\": {\".*\": {\"$ref\": \"defs/property_set.json\"}}}
- {\"price\": {\"$ref\": \"defs/scoped_property_set.json\"}}
- {\"lanes\": {\"$ref\": \"defs/scoped_property_set.json\"}}
- {\"ML_price\": {\"$ref\": \"defs/scoped_property_set.json\"}}
- {\"ML_lanes\": {\"$ref\": \"defs/scoped_property_set.json\"}}
Required:
- \u201cfacility\u201d
- \u201cproperty_changes\u201d
roadway_property_change
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"required\": [\n \"facility\",\n \"property_changes\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"facility\": {\n \"$ref\": \"../roadway/selection/select_segment.json\"\n },\n \"property_changes\": {\n \"type\": \"object\",\n \"minItems\": 1,\n \"anyOf\": [\n {\n \"patternProperties\": {\n \".*\": {\n \"$ref\": \"defs/property_set.json\"\n }\n }\n },\n {\n \"price\": {\n \"$ref\": \"defs/scoped_property_set.json\"\n }\n },\n {\n \"lanes\": {\n \"$ref\": \"defs/scoped_property_set.json\"\n }\n },\n {\n \"ML_price\": {\n \"$ref\": \"defs/scoped_property_set.json\"\n }\n },\n {\n \"ML_lanes\": {\n \"$ref\": \"defs/scoped_property_set.json\"\n }\n }\n ]\n }\n }\n}\n
"},{"location":"json-schemas/#changestransit_route_additionjson","title":"changes.transit_route_addition.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions routes
array
of Any
items. - Required:
- \u201croutes\u201d
transit_route_addition
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"required\": [\n \"routes\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"routes\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../transit/transit_route.json\"\n }\n }\n }\n}\n
"},{"location":"json-schemas/#changestransit_service_deletionjson","title":"changes.transit_service_deletion.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions service
../transit/selection/select_trips.json
- clean_shapes
boolean
If true, unused shapes for these trips will be removed. Defaults to false. clean_routes
boolean
If true, unused routes for these trips will be removed. Defaults to false. Required:
- \u201cservice\u201d
- \u201cclean_shapes\u201d
- \u201cclean_routes\u201d
transit_service_deletion
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"required\": [\n \"service\",\n \"clean_shapes\",\n \"clean_routes\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"service\": {\n \"$ref\": \"../transit/selection/select_trips.json\"\n },\n \"clean_shapes\": {\n \"type\": \"boolean\",\n \"description\": \"If true, unused shapes for these trips will be removed. Defaults to false.\",\n \"default\": false\n },\n \"clean_routes\": {\n \"type\": \"boolean\",\n \"description\": \"If true, unused routes for these trips will be removed. Defaults to false.\",\n \"default\": false\n }\n }\n}\n
"},{"location":"json-schemas/#changesroadway_additionjson","title":"changes.roadway_addition.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions links
array
of Any
items. - nodes
array
of Any
items. - Any Of:
- {\u201crequired\u201d: [\u201clinks\u201d]}
- {\u201crequired\u201d: [\u201cnodes\u201d]}
roadway_addition
Example 1 {\n \"links\": [\n {\n \"A\": 1,\n \"B\": 2,\n \"model_link_id\": 123,\n \"name\": \"Elm Street\",\n \"roadway\": \"residential\",\n \"lanes\": 2,\n \"price\": 0.75,\n \"walk_access\": 1,\n \"bike_access\": 1,\n \"bike_facility\": 1,\n \"drive_access\": 1,\n \"bus_only\": 0,\n \"rail_only\": 0\n }\n ],\n \"nodes\": [\n {\n \"model_node_id\": 1,\n \"X\": -122.419,\n \"Y\": 37.7\n },\n {\n \"model_node_id\": 2,\n \"X\": -122.419,\n \"Y\": 37.8\n }\n ]\n}\n
roadway_addition
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"anyOf\": [\n {\n \"required\": [\n \"links\"\n ]\n },\n {\n \"required\": [\n \"nodes\"\n ]\n }\n ],\n \"examples\": [\n {\n \"links\": [\n {\n \"A\": 1,\n \"B\": 2,\n \"model_link_id\": 123,\n \"name\": \"Elm Street\",\n \"roadway\": \"residential\",\n \"lanes\": 2,\n \"price\": 0.75,\n \"walk_access\": 1,\n \"bike_access\": 1,\n \"bike_facility\": 1,\n \"drive_access\": 1,\n \"bus_only\": 0,\n \"rail_only\": 0\n }\n ],\n \"nodes\": [\n {\n \"model_node_id\": 1,\n \"X\": -122.419,\n \"Y\": 37.7\n },\n {\n \"model_node_id\": 2,\n \"X\": -122.419,\n \"Y\": 37.8\n }\n ]\n }\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"links\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../roadway/roadway_link.json\"\n }\n },\n \"nodes\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../roadway/roadway_node.json\"\n }\n }\n }\n}\n
"},{"location":"json-schemas/#changesroadway_deletionjson","title":"changes.roadway_deletion.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions links
../roadway/selection/select_links.json
- nodes
../roadway/selection/select_nodes.json
- clean_shapes
boolean
If true, unused shapes for these links will be removed. Defaults to false. clean_nodes
boolean
If true, unused nodes for these links will be removed. Defaults to false. Any Of:
- {\u201crequired\u201d: [\u201clinks\u201d]}
- {\u201crequired\u201d: [\u201cnodes\u201d]}
roadway_deletion
Example 1 {\n \"links\": {\n \"model_link_id\": [\n 1,\n 2,\n 3\n ]\n }\n}\n
roadway_deletion
Example 2 {\n \"links\": {\n \"ref\": [\n \"I-5\"\n ],\n \"lanes\": 2\n }\n}\n
roadway_deletion
Example 3 {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ]\n }\n}\n
roadway_deletion
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"anyOf\": [\n {\n \"required\": [\n \"links\"\n ]\n },\n {\n \"required\": [\n \"nodes\"\n ]\n }\n ],\n \"examples\": [\n {\n \"links\": {\n \"model_link_id\": [\n 1,\n 2,\n 3\n ]\n }\n },\n {\n \"links\": {\n \"ref\": [\n \"I-5\"\n ],\n \"lanes\": 2\n }\n },\n {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ]\n }\n }\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"links\": {\n \"$ref\": \"../roadway/selection/select_links.json\"\n },\n \"nodes\": {\n \"$ref\": \"../roadway/selection/select_nodes.json\"\n },\n \"clean_shapes\": {\n \"type\": \"boolean\",\n \"description\": \"If true, unused shapes for these links will be removed. Defaults to false.\",\n \"default\": false\n },\n \"clean_nodes\": {\n \"type\": \"boolean\",\n \"description\": \"If true, unused nodes for these links will be removed. Defaults to false.\",\n \"default\": false\n }\n }\n}\n
"},{"location":"json-schemas/#changesdefsscoped_property_setjson","title":"changes.defs.scoped_property_set.json","text":"Type: Object
Definitions:
Definition Type Description Restrictions set_num
number
- change_num
number
- existing_value_conflict
string
Only used if \u2018existing\u2019 provided in project card and existing
doesn\u2019t match the existing network value. error
will raise an error, warn
will warn the user, and skip
will skip the change for that property (note it will still apply any remaining property changes). Defaults to warn
. Enumeration: error
,warn
,skip
overwrite_scoped
string
If \u2018all\u2019, all scoped items will be overwritten. If \u2018conflicting\u2019, only conflicting scoped items will be overwritten. If \u2018error\u2019, no scoped items will be overwritten and error will be raised if there are conflicts. Enumeration: all
,conflicting
,error
scoped_property_set_item
object
- One Of:- {\u201crequired\u201d: [\u201ctimespan\u201d, \u201cset\u201d]}
- {\u201crequired\u201d: [\u201ctimespan\u201d, \u201cchange\u201d]}
- {\u201crequired\u201d: [\u201ccategory\u201d, \u201cchange\u201d]}
- {\u201crequired\u201d: [\u201ccategory\u201d, \u201cset\u201d]}
Properties:
Property Type Description Restrictions existing
['number', 'string']
- set
#/$defs/set_num
- change
#/$defs/change_num
- scoped
array
of Any
items. - overwrite_scoped
#/$defs/overwrite_scoped
- existing_value_conflict
#/$defs/existing_value_conflict
- One Of:
- {\u201crequired\u201d: [\u201cset\u201d, \u201cscoped\u201d], \u201cnot\u201d: {\u201crequired\u201d: [\u201cchange\u201d]}}
- {\u201crequired\u201d: [\u201cchange\u201d, \u201cgroup\u201d], \u201cnot\u201d: {\u201crequired\u201d: [\u201cset\u201d]}}
scoped_property_set
Contents
{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"$defs\": {\n \"set_num\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"change_num\": {\n \"type\": \"number\"\n },\n \"existing_value_conflict\": {\n \"type\": \"string\",\n \"enum\": [\n \"error\",\n \"warn\",\n \"skip\"\n ],\n \"default\": \"warn\",\n \"description\": \"Only used if 'existing' provided in project card and `existing` doesn't match the existing network value. `error` will raise an error, `warn` will warn the user, and `skip` will skip the change for that property (note it will still apply any remaining property changes). Defaults to `warn`.\"\n },\n \"overwrite_scoped\": {\n \"type\": \"string\",\n \"enum\": [\n \"all\",\n \"conflicting\",\n \"error\"\n ],\n \"default\": \"error\",\n \"description\": \"If 'all', all scoped items will be overwritten. If 'conflicting', only conflicting scoped items will be overwritten. If 'error', no scoped items will be overwritten and error will be raised if there are conflicts.\"\n },\n \"scoped_property_set_item\": {\n \"type\": \"object\",\n \"examples\": [\n {\n \"timespan\": [\n \"7:00\",\n \"9:00\"\n ],\n \"set\": 0.5\n }\n ],\n \"oneOf\": [\n {\n \"required\": [\n \"timespan\",\n \"set\"\n ]\n },\n {\n \"required\": [\n \"timespan\",\n \"change\"\n ]\n },\n {\n \"required\": [\n \"category\",\n \"change\"\n ]\n },\n {\n \"required\": [\n \"category\",\n \"set\"\n ]\n }\n ],\n \"properties\": {\n \"set\": {\n \"$ref\": \"#/$defs/set_num\"\n },\n \"change\": {\n \"$ref\": \"#/$defs/change_num\"\n },\n \"category\": {\n \"type\": \"array\"\n },\n \"timespan\": {\n \"$ref\": \"../../defs/timespan.json\"\n },\n \"overwrite_scoped\": {\n \"$ref\": \"#/$defs/overwrite_scoped\"\n },\n \"existing_value_conflict\": {\n \"$ref\": \"#/$defs/existing_value_conflict\"\n }\n }\n }\n },\n \"oneOf\": [\n {\n \"required\": [\n \"set\",\n \"scoped\"\n ],\n \"not\": {\n \"required\": [\n \"change\"\n ]\n }\n },\n {\n \"required\": [\n \"change\",\n \"group\"\n ],\n \"not\": {\n \"required\": [\n \"set\"\n ]\n }\n }\n ],\n \"properties\": {\n \"existing\": {\n \"type\": [\n \"number\",\n \"string\"\n ]\n },\n \"set\": {\n \"$ref\": \"#/$defs/set_num\"\n },\n \"change\": {\n \"$ref\": \"#/$defs/change_num\"\n },\n \"scoped\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/scoped_property_set_item\"\n }\n },\n \"overwrite_scoped\": {\n \"$ref\": \"#/$defs/overwrite_scoped\"\n },\n \"existing_value_conflict\": {\n \"$ref\": \"#/$defs/existing_value_conflict\"\n }\n }\n}\n
"},{"location":"json-schemas/#changesdefsproperty_setjson","title":"changes.defs.property_set.json","text":"Type: Object
Definitions:
Definition Type Description Restrictions existing_value_conflict
string
Only used if \u2018existing\u2019 provided in project card and existing
doesn\u2019t match the existing network value. One of error
, warn
, or skip
. error
will raise an error, warn
will warn the user, and skip
will skip the change for that property (note it will still apply any remaining property changes). Will overwrite any WranglerConfig. Enumeration: error
,warn
,skip
Properties:
Property Type Description Restrictions existing
['number', 'string']
- change
['number', 'string']
- set
['number', 'string']
- existing_value_conflict
#/$defs/existing_value_conflict
- One Of:
- {\u201crequired\u201d: [\u201cchange\u201d], \u201cnot\u201d: {\u201crequired\u201d: [\u201cset\u201d]}}
- {\u201crequired\u201d: [\u201cset\u201d], \u201cnot\u201d: {\u201crequired\u201d: [\u201cchange\u201d]}}
property_set
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"$defs\": {\n \"existing_value_conflict\": {\n \"type\": \"string\",\n \"enum\": [\n \"error\",\n \"warn\",\n \"skip\"\n ],\n \"default\": \"false\",\n \"description\": \"Only used if 'existing' provided in project card and `existing` doesn't match the existing network value. One of `error`, `warn`, or `skip`. `error` will raise an error, `warn` will warn the user, and `skip` will skip the change for that property (note it will still apply any remaining property changes). Will overwrite any WranglerConfig.\"\n }\n },\n \"oneOf\": [\n {\n \"required\": [\n \"change\"\n ],\n \"not\": {\n \"required\": [\n \"set\"\n ]\n }\n },\n {\n \"required\": [\n \"set\"\n ],\n \"not\": {\n \"required\": [\n \"change\"\n ]\n }\n }\n ],\n \"properties\": {\n \"existing\": {\n \"type\": [\n \"number\",\n \"string\"\n ]\n },\n \"change\": {\n \"type\": [\n \"number\",\n \"string\"\n ]\n },\n \"set\": {\n \"type\": [\n \"number\",\n \"string\"\n ]\n },\n \"existing_value_conflict\": {\n \"$ref\": \"#/$defs/existing_value_conflict\"\n }\n }\n}\n
"},{"location":"json-schemas/#defsdependenciesjson","title":"defs.dependencies.json","text":"Type: Object
Additional Information:
-
additionalProperties: False
-
title: Project Dependencies
Properties:
Property Type Description Restrictions prerequisites
array
Project Prerequisites corequisites
array
Project Co-requisites conflicts
array
Project Conflicts Project Dependencies Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"title\": \"Project Dependencies\",\n \"properties\": {\n \"prerequisites\": {\n \"type\": \"array\",\n \"title\": \"Project Prerequisites\",\n \"examples\": [\n \"7th St E Road Diet\"\n ]\n },\n \"corequisites\": {\n \"type\": \"array\",\n \"title\": \"Project Co-requisites\",\n \"examples\": [\n \"7th St E Road Diet\"\n ]\n },\n \"conflicts\": {\n \"type\": \"array\",\n \"title\": \"Project Conflicts\",\n \"examples\": [\n \"7th St E Road Diet\"\n ]\n }\n }\n}\n
"},{"location":"json-schemas/#defsmodejson","title":"defs.mode.json","text":"Additional Information:
title: mode
Enumeration: drive
,walk
,bike
,transit
,any
mode Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"string\",\n \"title\": \"mode\",\n \"enum\": [\n \"drive\",\n \"walk\",\n \"bike\",\n \"transit\",\n \"any\"\n ]\n}\n
"},{"location":"json-schemas/#defstimejson","title":"defs.time.json","text":"Additional Information:
pattern: ^([0-9]|0[0-9]|1[0-9]|2[0-3]):0-5(:0-5)?$
time
Example 1 \"12:34\"\n
time
Example 2 \"12:34:56\"\n
time
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"string\",\n \"pattern\": \"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$\",\n \"examples\": [\n \"12:34\",\n \"12:34:56\"\n ]\n}\n
"},{"location":"json-schemas/#defstagsjson","title":"defs.tags.json","text":"Type: array
of string
items.
Property Value examples - \"vision2050\"
uniqueItems True Project Tags Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"array\",\n \"title\": \"Project Tags\",\n \"items\": {\n \"type\": \"string\",\n \"examples\": [\n \"vision2050\"\n ],\n \"uniqueItems\": true\n }\n}\n
"},{"location":"json-schemas/#defstimespanjson","title":"defs.timespan.json","text":"Type: array
of Any
items.
timespan
Example 1 [\n \"12:00\",\n \"19:45:00\"\n]\n
timespan
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"examples\": [\n [\n \"12:00\",\n \"19:45:00\"\n ]\n ],\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"time.json\"\n },\n \"minItems\": 2,\n \"maxItems\": 2\n}\n
"},{"location":"json-schemas/#roadwayroadway_nodejson","title":"roadway.roadway_node.json","text":"Type: Object
Additional Information:
-
description: Requirements for roadway nodes.
-
title: Roadway nodes
Definitions:
Definition Type Description Restrictions model_node_id
integer
Primary key to the nodes object. point
array
of Any
items. The Point Schema X
number
X coordinate (e.g. Longitude) Y
number
Y coordinate (e.g. Latitude) Z
number
Z coordinate (e.g. Altitude) osm_node_id
string
Reference to the corresponding Open Street Map node. shstReferenceId_node
string
Shared streets node ID reference. walk_node
['integer', 'boolean']
Indicates node is part of the pedestrian network. Useful for exporting or querying networks by mode. bike_node
['integer', 'boolean']
Indicates node is part of the bike network. Useful for exporting or querying networks by mode. drive_node
['integer', 'boolean']
Indicates node is part of the driving network. Useful for exporting or querying networks by mode. transit_node
['integer', 'boolean']
Indicates node is part of the transit network. Useful for exporting or querying networks by mode. Properties:
Property Type Description Restrictions model_node_id
#/$defs/model_node_id
- osm_node_id
#/$defs/osm_node_id
- shstReferenceId
#/$defs/shstReferenceId_node
- outboundReferenceIds
array
of Any
items. - inboundReferenceIds
array
of Any
items. - walk_node
#/$defs/walk_node
- bike_node
#/$defs/bike_node
- drive_node
#/$defs/drive_node
- transit_node
#/$defs/transit_node
- X
#/$defs/X
- Y
#/$defs/Y
- Z
#/$defs/Z
- Required:
- \u201cmodel_node_id\u201d
- \u201cX\u201d
- \u201cY\u201d
Roadway nodes Example 1 {\n \"model_node_id\": 1,\n \"X\": -122.419,\n \"Y\": 37.774\n}\n
Roadway nodes Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Requirements for roadway nodes.\",\n \"type\": \"object\",\n \"$defs\": {\n \"model_node_id\": {\n \"type\": \"integer\",\n \"uniqueItems\": true,\n \"description\": \"Primary key to the nodes object.\"\n },\n \"point\": {\n \"type\": \"array\",\n \"description\": \"The Point Schema\",\n \"minItems\": 2,\n \"maxItems\": 3,\n \"prefixItems\": [\n {\n \"$ref\": \"#/$defs/X\"\n },\n {\n \"$ref\": \"#/$defs/Y\"\n }\n ],\n \"items\": {\n \"$ref\": \"#/$defs/Z\"\n }\n },\n \"X\": {\n \"type\": \"number\",\n \"description\": \"X coordinate (e.g. Longitude)\"\n },\n \"Y\": {\n \"type\": \"number\",\n \"description\": \"Y coordinate (e.g. Latitude)\"\n },\n \"Z\": {\n \"type\": \"number\",\n \"description\": \"Z coordinate (e.g. Altitude)\"\n },\n \"osm_node_id\": {\n \"type\": \"string\",\n \"examples\": [\n \"954734870\"\n ],\n \"description\": \"Reference to the corresponding Open Street Map node.\"\n },\n \"shstReferenceId_node\": {\n \"type\": \"string\",\n \"examples\": [\n \"0751f5ce12472360fed0d0e80ceae35c\"\n ],\n \"description\": \"Shared streets node ID reference.\"\n },\n \"walk_node\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates node is part of the pedestrian network. Useful for exporting or querying networks by mode.\"\n },\n \"bike_node\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates node is part of the bike network. Useful for exporting or querying networks by mode.\"\n },\n \"drive_node\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates node is part of the driving network. Useful for exporting or querying networks by mode.\"\n },\n \"transit_node\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates node is part of the transit network. Useful for exporting or querying networks by mode.\"\n }\n },\n \"title\": \"Roadway nodes\",\n \"required\": [\n \"model_node_id\",\n \"X\",\n \"Y\"\n ],\n \"examples\": [\n {\n \"model_node_id\": 1,\n \"X\": -122.419,\n \"Y\": 37.774\n }\n ],\n \"properties\": {\n \"model_node_id\": {\n \"$ref\": \"#/$defs/model_node_id\"\n },\n \"osm_node_id\": {\n \"$ref\": \"#/$defs/osm_node_id\"\n },\n \"shstReferenceId\": {\n \"$ref\": \"#/$defs/shstReferenceId_node\"\n },\n \"outboundReferenceIds\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"roadway_link.json#/$defs/shstReferenceId_link\"\n }\n },\n \"inboundReferenceIds\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"roadway_link.json#/$defs/shstReferenceId_link\"\n }\n },\n \"walk_node\": {\n \"$ref\": \"#/$defs/walk_node\"\n },\n \"bike_node\": {\n \"$ref\": \"#/$defs/bike_node\"\n },\n \"drive_node\": {\n \"$ref\": \"#/$defs/drive_node\"\n },\n \"transit_node\": {\n \"$ref\": \"#/$defs/transit_node\"\n },\n \"X\": {\n \"$ref\": \"#/$defs/X\"\n },\n \"Y\": {\n \"$ref\": \"#/$defs/Y\"\n },\n \"Z\": {\n \"$ref\": \"#/$defs/Z\"\n }\n }\n}\n
"},{"location":"json-schemas/#roadwayroadway_linkjson","title":"roadway.roadway_link.json","text":"Type: Object
Additional Information:
-
description: Requirements for roadway links.
-
title: Roadway links
Definitions:
Definition Type Description Restrictions node
integer
Foreign key to the nodes object. intersectionId
string
The Intersectionid Schema shstReferenceId_link
string
The Shstreferenceid Schema shstGeometryId
string
The Shstgeometryid Schema bearing
integer
The angle of the eminating arc from the point, expressed in clockwise degrees from North (0) point
Any
- distance
number
Distance of facility in miles. If not provided, will be calculated provided nodes name
string
Name of Roadway facility. If multiple, can be contatenated with a comma. ref
string
Reference name of roadway, per Open Street Map definition. model_link_id
integer
Unique id for facility. osm_link_id
string
Reference to the corresponding Open Street Map link. Note that due to link splitting this may or may not be unique, and is not a required attribute. roadway
string
Roadway type, using OSM Highway values. Notes: * X_link
roadway types denote linkage roads going to/from roadway type X (i.e. on/off ramps, etc). * road
denotes unknown type. Enumeration: 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
locationReference
object
- Required:- \u201csequence\u201d
- \u201cpoint\u201d
locationReferences
array
of Any
items. The Locationreferences Schema scoped_number_property_value
Any
- One Of:- {\u201c$ref\u201d: \u201c#/$defs/number_property.by_time-of-day\u201d}
- {\u201c$ref\u201d: \u201c#/$defs/number_property.by_access-category\u201d}
- {\u201c$ref\u201d: \u201c#/$defs/number_property.by_access-category-and-time-of-day\u201d}
lanes
Any
Number of lanes either in simple or complex terms. One Of:- {\u201ctype\u201d: \u201cnumber\u201d, \u201cminimum\u201d: 0}
- {\u201c$ref\u201d: \u201c#/$defs/scoped_number_property_value\u201d}
ML_lanes
#/$defs/lanes
Lanes for a parallel managed lane facility. number_property.by_time-of-day
object
- Required:- \u201cdefault\u201d
- \u201ctimeofday\u201d
number_property.by_access-category
object
- Required:- \u201cdefault\u201d
- \u201cgroups\u201d
number_property.by_access-category-and-time-of-day
object
- Required:- \u201cdefault\u201d
- \u201ctimeofday\u201d
price
Any
Price of facility, either as a positive number of a complex type by time of day and/or access category. One Of:- {\u201ctype\u201d: \u201cnumber\u201d, \u201cminimum\u201d: 0}
- {\u201c$ref\u201d: \u201c#/$defs/scoped_number_property_value\u201d}
ML_price
#/$defs/price
Price for a parallel managed lane facility. walk_access
['integer', 'boolean']
Indicates if a facility is generally available for pedestrians. Must not be true if any of bus_only or rail_only are true. bike_access
['integer', 'boolean']
Indicates if a facility is generally available for cyclists. Must not be true if any of bus_only or rail_only are true. bike_facility
integer
Indicator for the category of bicycle facility on or along the roadway. If null, indicates unknown. If zero, indicates no facility. drive_access
['integer', 'boolean']
Indicates if a facility is generally available for driving. Must not be true if any of bus_only or rail_only are true. bus_only
['integer', 'boolean']
Indicates if a facility is rail-only if True. Must not be true if any of walk_access, bike_access, drive_access, rail_only are True. rail_only
['integer', 'boolean']
Indicates if a facility is rail-only if True. Must not be true if any of walk_access, bike_access, drive_access, bus_only are True. segment_id
['string', 'integer']
An identifier for segments of roadway. Can be useful for querying and setting values for parts of facilities, summary scripts, etc. ML_access_egress
Any
Indicates where a managed lane facility can by accessed or exited either by indicating all
for everywhere, or listing foreign keys to specific A-nodes. One Of:- {\u201ctype\u201d: \u201cstring\u201d, \u201cvalue\u201d: \u201call\u201d}
- {\u201ctype\u201d: \u201carray\u201d, \u201citems\u201d: {\u201c$ref\u201d: \u201c#/$defs/node\u201d}, \u201cminItems\u201d: 1}
Properties:
Property Type Description Restrictions A
#/$defs/node
- B
#/$defs/node
- model_link_id
#/$defs/model_link_id
- osm_link_id
#/$defs/osm_link_id
- shstReferenceId
#/$defs/shstReferenceId_link
- shstGeometryId
#/$defs/shstGeometryId
- locationReferences
#/$defs/locationReferences
- name
#/$defs/name
- ref
#/$defs/ref
- roadway
#/$defs/roadway
- lanes
#/$defs/lanes
- price
#/$defs/price
- ML_lanes
#/$defs/lanes
- ML_price
#/$defs/ML_price
- ML_access_point
#/$defs/ML_access_egress
- ML_egress_point
#/$defs/ML_access_egress
- walk_access
#/$defs/walk_access
- bike_access
#/$defs/bike_access
- bike_facility
#/$defs/bike_facility
- drive_access
#/$defs/drive_access
- bus_only
#/$defs/bus_only
- rail_only
#/$defs/rail_only
- segment_id
#/$defs/segment_id
- ignore_missing
boolean
- all
boolean
- Required:
- \u201cA\u201d
- \u201cB\u201d
- \u201cname\u201d
- \u201cmodel_link_id\u201d
- \u201croadway\u201d
- \u201clanes\u201d
- \u201cwalk_access\u201d
- \u201cbike_access\u201d
- \u201cdrive_access\u201d
Roadway links Example 1
{\n \"A\": 123,\n \"B\": 5543,\n \"model_link_id\": 123,\n \"name\": \"Elm Street\",\n \"roadway\": \"residential\",\n \"lanes\": 2,\n \"price\": 0.75,\n \"walk_access\": 1,\n \"bike_access\": 1,\n \"bike_facility\": 1,\n \"drive_access\": 1,\n \"bus_only\": 0,\n \"rail_only\": 0\n}\n
Roadway links Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Requirements for roadway links.\",\n \"type\": \"object\",\n \"$defs\": {\n \"node\": {\n \"type\": \"integer\",\n \"description\": \"Foreign key to the nodes object.\"\n },\n \"intersectionId\": {\n \"type\": \"string\",\n \"description\": \"The Intersectionid Schema\",\n \"examples\": [\n \"4d0231aa0ebb779f142c2518703ee481\"\n ]\n },\n \"shstReferenceId_link\": {\n \"type\": \"string\",\n \"description\": \"The Shstreferenceid Schema\",\n \"examples\": [\n \"6a22969708104ae2497244f3d079381d\"\n ]\n },\n \"shstGeometryId\": {\n \"type\": \"string\",\n \"description\": \"The Shstgeometryid Schema\",\n \"examples\": [\n \"6a22969708104ae2497244f3d079381d\"\n ]\n },\n \"bearing\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 360,\n \"description\": \"The angle of the eminating arc from the point, expressed in clockwise degrees from North (0)\",\n \"examples\": [\n 0,\n 90,\n 275\n ]\n },\n \"point\": {\n \"#ref\": \"roadway_node.json#/$defs/roadway_nodes_point\"\n },\n \"distance\": {\n \"type\": \"number\",\n \"title\": \"Distance\",\n \"description\": \"Distance of facility in miles. If not provided, will be calculated provided nodes\",\n \"minimum\": 0,\n \"examples\": [\n 93.08\n ]\n },\n \"name\": {\n \"type\": \"string\",\n \"examples\": [\n \"Elm Street\",\n \"Raleigh Beltline\",\n \"Capital Beltway\",\n \"3rd St,Willie Mays Blvd\"\n ],\n \"description\": \"Name of Roadway facility. If multiple, can be contatenated with a comma.\"\n },\n \"ref\": {\n \"type\": \"string\",\n \"examples\": [\n \"I-40\",\n \"US66\",\n \"WA520\"\n ],\n \"description\": \"Reference name of roadway, per Open Street Map definition.\"\n },\n \"model_link_id\": {\n \"type\": \"integer\",\n \"description\": \"Unique id for facility.\"\n },\n \"osm_link_id\": {\n \"type\": \"string\",\n \"description\": \"Reference to the corresponding Open Street Map link. Note that due to link splitting this may or may not be unique, and is not a required attribute.\"\n },\n \"roadway\": {\n \"type\": \"string\",\n \"enum\": [\n \"taz\",\n \"motorway\",\n \"trunk\",\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"unclassified\",\n \"residential\",\n \"motorway_link\",\n \"trunk_link\",\n \"primary_link\",\n \"secondary_link\",\n \"tertiary_link\",\n \"living_street\",\n \"service\",\n \"pedestrian\",\n \"footway\",\n \"steps\",\n \"cycleway\",\n \"track\",\n \"bus_guideway\",\n \"road\"\n ],\n \"default\": \"road\",\n \"description\": \"Roadway type, using [OSM Highway values](https://wiki.openstreetmap.org/wiki/Key:highway#Roads). Notes: * `X_link` roadway types denote linkage roads going to/from roadway type X (i.e. on/off ramps, etc). * `road` denotes unknown type.\"\n },\n \"locationReference\": {\n \"type\": \"object\",\n \"required\": [\n \"sequence\",\n \"point\"\n ],\n \"properties\": {\n \"sequence\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"point\": {\n \"$ref\": \"#/$defs/point\"\n },\n \"distanceToNextRef\": {\n \"$ref\": \"#/$defs/distance\"\n },\n \"bearing\": {\n \"$ref\": \"#/$defs/bearing\"\n },\n \"intersectionId\": {\n \"$ref\": \"#/$defs/intersectionId\"\n }\n }\n },\n \"locationReferences\": {\n \"type\": \"array\",\n \"description\": \"The Locationreferences Schema\",\n \"items\": {\n \"$ref\": \"#/$defs/locationReference\"\n }\n },\n \"scoped_number_property_value\": {\n \"oneOf\": [\n {\n \"$ref\": \"#/$defs/number_property.by_time-of-day\"\n },\n {\n \"$ref\": \"#/$defs/number_property.by_access-category\"\n },\n {\n \"$ref\": \"#/$defs/number_property.by_access-category-and-time-of-day\"\n }\n ]\n },\n \"lanes\": {\n \"oneOf\": [\n {\n \"type\": \"number\",\n \"minimum\": 0\n },\n {\n \"$ref\": \"#/$defs/scoped_number_property_value\"\n }\n ],\n \"examples\": [\n 2,\n 5,\n {\n \"default\": 1,\n \"timeofday\": {\n \"timespan\": [\n \"6:00\",\n \"9:00\"\n ],\n \"value\": 2\n }\n }\n ],\n \"description\": \"Number of lanes either in simple or complex terms.\"\n },\n \"ML_lanes\": {\n \"$ref\": \"#/$defs/lanes\",\n \"description\": \"Lanes for a parallel managed lane facility.\"\n },\n \"number_property.by_time-of-day\": {\n \"type\": \"object\",\n \"examples\": [\n {\n \"default\": 1,\n \"timeofday\": [\n {\n \"timespan\": [\n \"7:00\",\n \"9:00\"\n ],\n \"value\": 0.5\n }\n ]\n }\n ],\n \"required\": [\n \"default\",\n \"timeofday\"\n ],\n \"properties\": {\n \"default\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"timeofday\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"timespan\",\n \"value\"\n ],\n \"properties\": {\n \"timespan\": {\n \"$ref\": \"../defs/timespan.json\"\n },\n \"value\": {\n \"type\": \"number\",\n \"minimum\": 0\n }\n }\n }\n }\n }\n },\n \"number_property.by_access-category\": {\n \"type\": \"object\",\n \"required\": [\n \"default\",\n \"groups\"\n ],\n \"examples\": [\n {\n \"default\": 1,\n \"groups\": [\n {\n \"category\": [\n \"HOV2\"\n ],\n \"value\": 0.5\n }\n ]\n }\n ],\n \"properties\": {\n \"default\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"group\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"category\",\n \"value\"\n ],\n \"properties\": {\n \"category\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"value\": {\n \"type\": \"number\",\n \"minimum\": 0\n }\n }\n }\n }\n }\n },\n \"number_property.by_access-category-and-time-of-day\": {\n \"type\": \"object\",\n \"required\": [\n \"default\",\n \"timeofday\"\n ],\n \"examples\": [\n {\n \"default\": 1,\n \"timeofday\": [\n {\n \"timespan\": [\n \"7:00\",\n \"9:00\"\n ],\n \"category\": [\n \"HOV2\"\n ],\n \"value\": 0.5\n }\n ]\n }\n ],\n \"properties\": {\n \"default\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"timeofday\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"category\",\n \"timespan\",\n \"value\"\n ],\n \"properties\": {\n \"category\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"timespan\": {\n \"$ref\": \"../defs/timespan.json\"\n },\n \"value\": {\n \"type\": \"number\",\n \"minimum\": 0\n }\n }\n }\n }\n }\n },\n \"price\": {\n \"oneOf\": [\n {\n \"type\": \"number\",\n \"minimum\": 0\n },\n {\n \"$ref\": \"#/$defs/scoped_number_property_value\"\n }\n ],\n \"default\": 0,\n \"examples\": [\n 0.75,\n 2.9,\n {\n \"default\": 1,\n \"timeofday\": {\n \"time\": [\n \"6:00\",\n \"9:00\"\n ],\n \"value\": 2\n }\n }\n ],\n \"description\": \"Price of facility, either as a positive number of a complex type by time of day and/or access category.\"\n },\n \"ML_price\": {\n \"$ref\": \"#/$defs/price\",\n \"description\": \"Price for a parallel managed lane facility.\"\n },\n \"walk_access\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates if a facility is generally available for pedestrians. Must not be true if any of bus_only or rail_only are true.\"\n },\n \"bike_access\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates if a facility is generally available for cyclists. Must not be true if any of bus_only or rail_only are true.\"\n },\n \"bike_facility\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"description\": \"Indicator for the category of bicycle facility on or along the roadway. If null, indicates unknown. If zero, indicates no facility.\"\n },\n \"drive_access\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates if a facility is generally available for driving. Must not be true if any of bus_only or rail_only are true.\"\n },\n \"bus_only\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"default\": 0,\n \"description\": \"Indicates if a facility is rail-only if True. Must not be true if any of walk_access, bike_access, drive_access, rail_only are True.\"\n },\n \"rail_only\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"default\": 0,\n \"description\": \"Indicates if a facility is rail-only if True. Must not be true if any of walk_access, bike_access, drive_access, bus_only are True.\"\n },\n \"segment_id\": {\n \"type\": [\n \"string\",\n \"integer\"\n ],\n \"description\": \"An identifier for segments of roadway. Can be useful for querying and setting values for parts of facilities, summary scripts, etc.\"\n },\n \"ML_access_egress\": {\n \"oneOf\": [\n {\n \"type\": \"string\",\n \"value\": \"all\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/node\"\n },\n \"minItems\": 1\n }\n ],\n \"examples\": [\n \"all\",\n [\n 123,\n 5543\n ]\n ],\n \"description\": \"Indicates where a managed lane facility can by accessed or exited either by indicating `all` for everywhere, or listing foreign keys to specific A-nodes.\"\n }\n },\n \"title\": \"Roadway links\",\n \"required\": [\n \"A\",\n \"B\",\n \"name\",\n \"model_link_id\",\n \"roadway\",\n \"lanes\",\n \"walk_access\",\n \"bike_access\",\n \"drive_access\"\n ],\n \"examples\": [\n {\n \"A\": 123,\n \"B\": 5543,\n \"model_link_id\": 123,\n \"name\": \"Elm Street\",\n \"roadway\": \"residential\",\n \"lanes\": 2,\n \"price\": 0.75,\n \"walk_access\": 1,\n \"bike_access\": 1,\n \"bike_facility\": 1,\n \"drive_access\": 1,\n \"bus_only\": 0,\n \"rail_only\": 0\n }\n ],\n \"properties\": {\n \"A\": {\n \"$ref\": \"#/$defs/node\"\n },\n \"B\": {\n \"$ref\": \"#/$defs/node\"\n },\n \"model_link_id\": {\n \"$ref\": \"#/$defs/model_link_id\"\n },\n \"osm_link_id\": {\n \"$ref\": \"#/$defs/osm_link_id\"\n },\n \"shstReferenceId\": {\n \"$ref\": \"#/$defs/shstReferenceId_link\"\n },\n \"shstGeometryId\": {\n \"$ref\": \"#/$defs/shstGeometryId\"\n },\n \"locationReferences\": {\n \"$ref\": \"#/$defs/locationReferences\"\n },\n \"name\": {\n \"$ref\": \"#/$defs/name\"\n },\n \"ref\": {\n \"$ref\": \"#/$defs/ref\"\n },\n \"roadway\": {\n \"$ref\": \"#/$defs/roadway\"\n },\n \"lanes\": {\n \"$ref\": \"#/$defs/lanes\"\n },\n \"price\": {\n \"$ref\": \"#/$defs/price\"\n },\n \"ML_lanes\": {\n \"$ref\": \"#/$defs/lanes\"\n },\n \"ML_price\": {\n \"$ref\": \"#/$defs/ML_price\"\n },\n \"ML_access_point\": {\n \"$ref\": \"#/$defs/ML_access_egress\"\n },\n \"ML_egress_point\": {\n \"$ref\": \"#/$defs/ML_access_egress\"\n },\n \"walk_access\": {\n \"$ref\": \"#/$defs/walk_access\"\n },\n \"bike_access\": {\n \"$ref\": \"#/$defs/bike_access\"\n },\n \"bike_facility\": {\n \"$ref\": \"#/$defs/bike_facility\"\n },\n \"drive_access\": {\n \"$ref\": \"#/$defs/drive_access\"\n },\n \"bus_only\": {\n \"$ref\": \"#/$defs/bus_only\"\n },\n \"rail_only\": {\n \"$ref\": \"#/$defs/rail_only\"\n },\n \"segment_id\": {\n \"$ref\": \"#/$defs/segment_id\"\n },\n \"ignore_missing\": {\n \"type\": \"boolean\"\n },\n \"all\": {\n \"type\": \"boolean\"\n }\n }\n}\n
"},{"location":"json-schemas/#roadwayselectionselect_linksjson","title":"roadway.selection.select_links.json","text":"Type: Object
Additional Information:
-
description: requirements for describing links in the facility
section of a project card.
-
title: Roadway link selection
-
additionalProperties: True
-
not: {\u2018anyOf\u2019: [{\u2018required\u2019: [\u2018from\u2019]}, {\u2018required\u2019: [\u2018to\u2019]}]}
Properties:
Property Type Description Restrictions all
Any
- Enumeration: True
,False
name
array
of Any
items. - ref
array
of Any
items. - osm_link_id
array
of Any
items. - model_link_id
array
of Any
items. - modes
array
of Any
items. - ignore_missing
boolean
If true, missing links for explicit ID selections will be ignored. Defaults to true. Required:
- \u201cignore_missing\u201d
One Of:- {\u201crequired\u201d: [\u201cname\u201d]}
- {\u201crequired\u201d: [\u201cref\u201d]}
- {\u201crequired\u201d: [\u201cosm_link_id\u201d]}
- {\u201crequired\u201d: [\u201cmodel_link_id\u201d]}
- {\u201crequired\u201d: [\u201call\u201d]}
Roadway link selection Example 1 {\n \"name\": [\n \"Main St\"\n ],\n \"modes\": [\n \"drive\"\n ]\n}\n
Roadway link selection Example 2 {\n \"osm_link_id\": [\n \"123456789\"\n ]\n}\n
Roadway link selection Example 3 {\n \"model_link_id\": [\n 123456789\n ],\n \"modes\": [\n \"walk\"\n ]\n}\n
Roadway link selection Example 4 {\n \"all\": \"True\",\n \"modes\": [\n \"transit\"\n ]\n}\n
Roadway link selection Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"requirements for describing links in the `facility` section of a project card.\",\n \"type\": \"object\",\n \"title\": \"Roadway link selection\",\n \"required\": [\n \"ignore_missing\"\n ],\n \"oneOf\": [\n {\n \"required\": [\n \"name\"\n ]\n },\n {\n \"required\": [\n \"ref\"\n ]\n },\n {\n \"required\": [\n \"osm_link_id\"\n ]\n },\n {\n \"required\": [\n \"model_link_id\"\n ]\n },\n {\n \"required\": [\n \"all\"\n ]\n }\n ],\n \"additionalProperties\": true,\n \"not\": {\n \"anyOf\": [\n {\n \"required\": [\n \"from\"\n ]\n },\n {\n \"required\": [\n \"to\"\n ]\n }\n ]\n },\n \"examples\": [\n {\n \"name\": [\n \"Main St\"\n ],\n \"modes\": [\n \"drive\"\n ]\n },\n {\n \"osm_link_id\": [\n \"123456789\"\n ]\n },\n {\n \"model_link_id\": [\n 123456789\n ],\n \"modes\": [\n \"walk\"\n ]\n },\n {\n \"all\": \"True\",\n \"modes\": [\n \"transit\"\n ]\n }\n ],\n \"properties\": {\n \"all\": {\n \"enum\": [\n \"True\",\n \"False\"\n ]\n },\n \"name\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_link.json#/$defs/name\"\n }\n },\n \"ref\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_link.json#/$defs/ref\"\n }\n },\n \"osm_link_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_link.json#/$defs/osm_link_id\"\n }\n },\n \"model_link_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_link.json#/$defs/model_link_id\"\n }\n },\n \"modes\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../../defs/mode.json\"\n }\n },\n \"ignore_missing\": {\n \"type\": \"boolean\",\n \"description\": \"If true, missing links for explicit ID selections will be ignored. Defaults to true.\",\n \"default\": true\n }\n }\n}\n
"},{"location":"json-schemas/#roadwayselectionselect_segmentjson","title":"roadway.selection.select_segment.json","text":"Type: Object
Additional Information:
-
id: facility_roadway
-
additionalProperties: False
-
title: Roadway Facility Selection
Properties:
Property Type Description Restrictions links
select_links.json
- nodes
select_nodes.json
- from
select_node.json
- to
select_node.json
- Any Of:
- {\u201crequired\u201d: [\u201clinks\u201d, \u201cfrom\u201d, \u201cto\u201d]}
- {\u201crequired\u201d: [\u201clinks\u201d]}
- {\u201crequired\u201d: [\u201cnodes\u201d]}
Roadway Facility Selection Example 1 {\n \"links\": {\n \"name\": [\n \"Main Street\"\n ]\n },\n \"from\": {\n \"model_node_id\": 1\n },\n \"to\": {\n \"model_node_id\": 2\n }\n}\n
Roadway Facility Selection Example 2 {\n \"nodes\": {\n \"osm_node_id\": [\n \"1\",\n \"2\",\n \"3\"\n ]\n }\n}\n
Roadway Facility Selection Example 3 {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ]\n }\n}\n
Roadway Facility Selection Example 4 {\n \"links\": {\n \"model_link_id\": [\n 1,\n 2,\n 3\n ]\n }\n}\n
Roadway Facility Selection Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"object\",\n \"id\": \"facility_roadway\",\n \"additionalProperties\": false,\n \"anyOf\": [\n {\n \"required\": [\n \"links\",\n \"from\",\n \"to\"\n ]\n },\n {\n \"required\": [\n \"links\"\n ]\n },\n {\n \"required\": [\n \"nodes\"\n ]\n }\n ],\n \"title\": \"Roadway Facility Selection\",\n \"examples\": [\n {\n \"links\": {\n \"name\": [\n \"Main Street\"\n ]\n },\n \"from\": {\n \"model_node_id\": 1\n },\n \"to\": {\n \"model_node_id\": 2\n }\n },\n {\n \"nodes\": {\n \"osm_node_id\": [\n \"1\",\n \"2\",\n \"3\"\n ]\n }\n },\n {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ]\n }\n },\n {\n \"links\": {\n \"model_link_id\": [\n 1,\n 2,\n 3\n ]\n }\n }\n ],\n \"properties\": {\n \"links\": {\n \"$ref\": \"select_links.json\"\n },\n \"nodes\": {\n \"$ref\": \"select_nodes.json\"\n },\n \"from\": {\n \"$ref\": \"select_node.json\"\n },\n \"to\": {\n \"$ref\": \"select_node.json\"\n }\n }\n}\n
"},{"location":"json-schemas/#roadwayselectionselect_nodejson","title":"roadway.selection.select_node.json","text":"Type: Object
Additional Information:
-
description: Selection of a single roadway node in the facility
section of a project card.
-
title: Single roadway network node
-
additionalProperties: False
Properties:
Property Type Description Restrictions osm_node_id
../roadway_node.json#/$defs/osm_node_id
- model_node_id
../roadway_node.json#/$defs/model_node_id
- One Of:
- {\u201crequired\u201d: [\u201cosm_node_id\u201d]}
- {\u201crequired\u201d: [\u201cmodel_node_id\u201d]}
Single roadway network node Example 1 {\n \"osm_node_id\": \"12345\"\n}\n
Single roadway network node Example 2 {\n \"model_node_id\": 67890\n}\n
Single roadway network node Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"object\",\n \"description\": \"Selection of a single roadway node in the `facility` section of a project card.\",\n \"title\": \"Single roadway network node\",\n \"additionalProperties\": false,\n \"oneOf\": [\n {\n \"required\": [\n \"osm_node_id\"\n ]\n },\n {\n \"required\": [\n \"model_node_id\"\n ]\n }\n ],\n \"examples\": [\n {\n \"osm_node_id\": \"12345\"\n },\n {\n \"model_node_id\": 67890\n }\n ],\n \"properties\": {\n \"osm_node_id\": {\n \"$ref\": \"../roadway_node.json#/$defs/osm_node_id\"\n },\n \"model_node_id\": {\n \"$ref\": \"../roadway_node.json#/$defs/model_node_id\"\n }\n }\n}\n
"},{"location":"json-schemas/#roadwayselectionselect_nodesjson","title":"roadway.selection.select_nodes.json","text":"Type: Object
Additional Information:
-
description: requirements for describing multiple nodes of a project card (e.g. to delete).
-
additionalProperties: False
-
title: Roadway network node
Properties:
Property Type Description Restrictions osm_node_id
array
of Any
items. - model_node_id
array
of Any
items. - ignore_missing
boolean
If true, missing nodes for explicit ID selections will be ignored. Defaults to true. all
boolean
- Required:
- \u201cignore_missing\u201d
Any Of:- {\u201crequired\u201d: [\u201cosm_node_id\u201d]}
- {\u201crequired\u201d: [\u201cmodel_node_id\u201d]}
Roadway network node Example 1 {\n \"osm_node_id\": [\n \"12345\",\n \"67890\"\n ],\n \"model_node_id\": [\n 12345,\n 67890\n ]\n}\n
Roadway network node Example 2 {\n \"osm_node_id\": [\n \"12345\",\n \"67890\"\n ]\n}\n
Roadway network node Example 3 {\n \"model_node_id\": [\n 12345,\n 67890\n ]\n}\n
Roadway network node Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"requirements for describing multiple nodes of a project card (e.g. to delete).\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"title\": \"Roadway network node\",\n \"required\": [\n \"ignore_missing\"\n ],\n \"anyOf\": [\n {\n \"required\": [\n \"osm_node_id\"\n ]\n },\n {\n \"required\": [\n \"model_node_id\"\n ]\n }\n ],\n \"examples\": [\n {\n \"osm_node_id\": [\n \"12345\",\n \"67890\"\n ],\n \"model_node_id\": [\n 12345,\n 67890\n ]\n },\n {\n \"osm_node_id\": [\n \"12345\",\n \"67890\"\n ]\n },\n {\n \"model_node_id\": [\n 12345,\n 67890\n ]\n }\n ],\n \"properties\": {\n \"osm_node_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_node.json#/$defs/osm_node_id\"\n }\n },\n \"model_node_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_node.json#/$defs/model_node_id\"\n }\n },\n \"ignore_missing\": {\n \"type\": \"boolean\",\n \"description\": \"If true, missing nodes for explicit ID selections will be ignored. Defaults to true.\",\n \"default\": true\n },\n \"all\": {\n \"type\": \"boolean\"\n }\n }\n}\n
"},{"location":"json-schemas/#transittransit_stopjson","title":"transit.transit_stop.json","text":"Type: Object
Additional Information:
-
description: Transit stop properties.
-
additionalProperties: True
Definitions:
Definition Type Description Restrictions stop_id
string
ID for specific transit stop. Properties:
Property Type Description Restrictions stop_id
#/$defs/stop_id
- transit_stop
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Transit stop properties.\",\n \"type\": \"object\",\n \"$defs\": {\n \"stop_id\": {\n \"type\": \"string\",\n \"description\": \"ID for specific transit stop.\"\n }\n },\n \"additionalProperties\": true,\n \"properties\": {\n \"stop_id\": {\n \"$ref\": \"#/$defs/stop_id\"\n }\n }\n}\n
"},{"location":"json-schemas/#transittransit_routejson","title":"transit.transit_route.json","text":"Type: Object
Additional Information:
description: Transit service properties.
Definitions:
Definition Type Description Restrictions agency_id
string
ID for agency. route_id
string
ID for general route. route_short_name
string
Route short name. route_long_name
string
Route long name. route_type
integer
Route type. Enumeration: 0
,1
,2
,3
,4
,5
,6
,7
,11
,12
Properties:
Property Type Description Restrictions route_id
#/$defs/route_id
- agency_id
#/$defs/agency_id
- route_short_name
#/$defs/route_short_name
- route_long_name
#/$defs/route_long_name
- route_type
#/$defs/route_type
- trips
array
of Any
items. - Required:
- \u201croute_id\u201d
- \u201cagency_id\u201d
- \u201croute_type\u201d
transit_route
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Transit service properties.\",\n \"type\": \"object\",\n \"$defs\": {\n \"agency_id\": {\n \"type\": \"string\",\n \"description\": \"ID for agency.\"\n },\n \"route_id\": {\n \"type\": \"string\",\n \"description\": \"ID for general route.\"\n },\n \"route_short_name\": {\n \"type\": \"string\",\n \"description\": \"Route short name.\"\n },\n \"route_long_name\": {\n \"type\": \"string\",\n \"description\": \"Route long name.\"\n },\n \"route_type\": {\n \"type\": \"integer\",\n \"description\": \"Route type.\",\n \"enum\": [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 11,\n 12\n ],\n \"enumDescriptions\": [\n \"Tram, Streetcar, Light rail. Any light rail or street level system within a metropolitan area.\",\n \"Subway, Metro. Any underground rail system within a metropolitan area.\",\n \"Rail. Used for intercity or long-distance travel.\",\n \"Bus. Used for short- and long-distance bus routes.\",\n \"Ferry. Used for short- and long-distance boat service.\",\n \"Cable tram. Used for street-level rail cars where the cable runs beneath the vehicle, e.g., cable car in San Francisco.\",\n \"Aerial lift, suspended cable car (e.g., gondola lift, aerial tramway). Cable transport where cabins, cars, gondolas or open chairs are suspended by means of one or more cables.\",\n \"Funicular. Any rail system designed for steep inclines.\",\n \"Trolleybus. Electric buses that draw power from overhead wires using poles.\",\n \"Monorail. Railway in which the track consists of a single rail or a beam.\"\n ]\n }\n },\n \"required\": [\n \"route_id\",\n \"agency_id\",\n \"route_type\"\n ],\n \"properties\": {\n \"route_id\": {\n \"$ref\": \"#/$defs/route_id\"\n },\n \"agency_id\": {\n \"$ref\": \"#/$defs/agency_id\"\n },\n \"route_short_name\": {\n \"$ref\": \"#/$defs/route_short_name\"\n },\n \"route_long_name\": {\n \"$ref\": \"#/$defs/route_long_name\"\n },\n \"route_type\": {\n \"$ref\": \"#/$defs/route_type\"\n },\n \"trips\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../transit/transit_trip.json\"\n }\n }\n }\n}\n
"},{"location":"json-schemas/#transittransit_routingjson","title":"transit.transit_routing.json","text":"Type: array
of Any
items.
Property Value anyOf - {\"$ref\": \"#/$defs/detailed_route_stop\"}
- {\"$ref\": \"#/$defs/stop_id_str\"}
- {\"type\": \"integer\"}
Definitions:
Definition Type Description Restrictions stop_id_str
string
ID for stop. detailed_route_stop
object
Stop with detailed attributes. route_stop_attributes
object
Stop charactersitics for a given trip pattern. transit_routing
Example 1 [\n {\n \"1\": {\n \"stop\": true\n }\n },\n {\n \"2\": {\n \"stop\": true\n }\n },\n {\n \"3\": {\n \"stop\": true\n }\n },\n {\n \"4\": {\n \"stop\": true\n }\n },\n {\n \"5\": {\n \"stop\": true,\n \"dwell_sec\": 30\n }\n },\n \"6\"\n]\n
transit_routing
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Transit trip pattern / routing properties.\",\n \"type\": \"array\",\n \"$defs\": {\n \"stop_id_str\": {\n \"type\": \"string\",\n \"description\": \"ID for stop.\",\n \"regex\": \"^[0-9]+$\"\n },\n \"detailed_route_stop\": {\n \"type\": \"object\",\n \"description\": \"Stop with detailed attributes.\",\n \"properties\": {},\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/route_stop_attributes\"\n },\n \"propertyNames\": {\n \"ref\": \"#/$defs/stop_id_str\"\n },\n \"minProperties\": 1,\n \"maxProperties\": 1,\n \"examples\": [\n {\n \"1\": {\n \"stop\": true\n }\n }\n ]\n },\n \"route_stop_attributes\": {\n \"type\": \"object\",\n \"description\": \"Stop charactersitics for a given trip pattern.\",\n \"additionalProperties\": false,\n \"properties\": {\n \"stop\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Whether this is a stop. Defaults to False.\"\n },\n \"dwell_sec\": {\n \"type\": \"integer\",\n \"description\": \"Dwell time in seconds.\"\n },\n \"time_to_next_node_sec\": {\n \"type\": \"integer\",\n \"description\": \"Time to next node in seconds. Defaults to network travel time.\"\n },\n \"board\": {\n \"type\": \"boolean\",\n \"description\": \"Whether passengers can board at this stop.Defaults to True if stop=true. specify only when not default.\"\n },\n \"alight\": {\n \"type\": \"boolean\",\n \"description\": \"Whether passengers can alight at this stop. Defaults to True if stop=true. specify only when not default.\"\n }\n }\n }\n },\n \"minItems\": 2,\n \"items\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/detailed_route_stop\"\n },\n {\n \"$ref\": \"#/$defs/stop_id_str\"\n },\n {\n \"type\": \"integer\"\n }\n ]\n },\n \"examples\": [\n [\n {\n \"1\": {\n \"stop\": true\n }\n },\n {\n \"2\": {\n \"stop\": true\n }\n },\n {\n \"3\": {\n \"stop\": true\n }\n },\n {\n \"4\": {\n \"stop\": true\n }\n },\n {\n \"5\": {\n \"stop\": true,\n \"dwell_sec\": 30\n }\n },\n \"6\"\n ]\n ]\n}\n
"},{"location":"json-schemas/#transittransit_tripjson","title":"transit.transit_trip.json","text":"Type: Object
Additional Information:
description: Transit trip properties.
Definitions:
Definition Type Description Restrictions trip_id
string
ID for Individual trip a transit vehicle takes.. shape_id
string
ID for shape trip is following. service_id
string
ID for service schedule. trip_short_name
string
Route short name, often something like 38X
. trip_headsign
string
Trip Headsign. direction_id
integer
Consistent with GTFS definition defining outbound vs inbound routes. Enumeration: 0
,1
headway_secs_item
object
Headway for each time period. Properties:
Property Type Description Restrictions trip_id
#/$defs/trip_id
- service_id
#/$defs/service_id
- shape_id
#/$defs/shape_id
- route_id
transit_route.json#/$defs/route_id
- trip_headsign
#/$defs/trip_headsign
- trip_short_name
#/$defs/trip_short_name
- direction_id
#/$defs/direction_id
- headway_secs
array
of Any
items. - routing
transit_routing.json
- Required:
- \u201cheadway_secs\u201d
- \u201crouting\u201d
transit_trip
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Transit trip properties.\",\n \"type\": \"object\",\n \"$defs\": {\n \"trip_id\": {\n \"type\": \"string\",\n \"description\": \"ID for Individual trip a transit vehicle takes..\"\n },\n \"shape_id\": {\n \"type\": \"string\",\n \"description\": \"ID for shape trip is following.\"\n },\n \"service_id\": {\n \"type\": \"string\",\n \"description\": \"ID for service schedule.\"\n },\n \"trip_short_name\": {\n \"type\": \"string\",\n \"description\": \"Route short name, often something like `38X`.\"\n },\n \"trip_headsign\": {\n \"type\": \"string\",\n \"description\": \"Trip Headsign.\"\n },\n \"direction_id\": {\n \"type\": \"integer\",\n \"enum\": [\n 0,\n 1\n ],\n \"description\": \"Consistent with GTFS definition defining outbound vs inbound routes.\"\n },\n \"headway_secs_item\": {\n \"type\": \"object\",\n \"examples\": [\n {\n \"('7:00', '9:00')\": 600\n }\n ],\n \"description\": \"Headway for each time period.\"\n }\n },\n \"required\": [\n \"headway_secs\",\n \"routing\"\n ],\n \"properties\": {\n \"trip_id\": {\n \"$ref\": \"#/$defs/trip_id\"\n },\n \"service_id\": {\n \"$ref\": \"#/$defs/service_id\"\n },\n \"shape_id\": {\n \"$ref\": \"#/$defs/shape_id\"\n },\n \"route_id\": {\n \"$ref\": \"transit_route.json#/$defs/route_id\"\n },\n \"trip_headsign\": {\n \"$ref\": \"#/$defs/trip_headsign\"\n },\n \"trip_short_name\": {\n \"$ref\": \"#/$defs/trip_short_name\"\n },\n \"direction_id\": {\n \"$ref\": \"#/$defs/direction_id\"\n },\n \"headway_secs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/headway_secs_item\"\n }\n },\n \"routing\": {\n \"$ref\": \"transit_routing.json\"\n }\n }\n}\n
"},{"location":"json-schemas/#transitselectionselect_route_propertiesjson","title":"transit.selection.select_route_properties.json","text":"Type: Object
Additional Information:
-
description: Selection proeprties for transit routes.
-
additionalProperties: True
Properties:
Property Type Description Restrictions route_short_name
array
of Any
items. - route_long_name
array
of Any
items. - agency_id
array
of Any
items. - route_type
array
of Any
items. - select_route_properties
Example 1 {\n \"route_short_name\": [\n \"1\",\n \"2\",\n \"3\"\n ]\n}\n
select_route_properties
Example 2 {\n \"agency_id\": [\n \"1\"\n ],\n \"route_long_name\": [\n \"Route 1\",\n \"Route 2\",\n \"Route 3\"\n ]\n}\n
select_route_properties
Example 3 {\n \"agency_id\": [\n \"1\"\n ],\n \"route_type\": [\n 0,\n 1,\n 2\n ]\n}\n
select_route_properties
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Selection proeprties for transit routes.\",\n \"type\": \"object\",\n \"additionalProperties\": true,\n \"examples\": [\n {\n \"route_short_name\": [\n \"1\",\n \"2\",\n \"3\"\n ]\n },\n {\n \"agency_id\": [\n \"1\"\n ],\n \"route_long_name\": [\n \"Route 1\",\n \"Route 2\",\n \"Route 3\"\n ]\n },\n {\n \"agency_id\": [\n \"1\"\n ],\n \"route_type\": [\n 0,\n 1,\n 2\n ]\n }\n ],\n \"properties\": {\n \"route_short_name\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_route.json#/$defs/route_short_name\"\n }\n },\n \"route_long_name\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_route.json#/$defs/route_long_name\"\n }\n },\n \"agency_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_route.json#/$defs/agency_id\"\n }\n },\n \"route_type\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_route.json#/$defs/route_type\"\n }\n }\n }\n}\n
"},{"location":"json-schemas/#transitselectionselect_tripsjson","title":"transit.selection.select_trips.json","text":"Type: Object
Additional Information:
-
additionalProperties: False
-
title: Transit Service Facility Selection
Properties:
Property Type Description Restrictions trip_properties
select_trip_properties.json
- route_properties
select_route_properties.json
- timespans
array
of Any
items. - nodes
select_nodes.json
- Transit Service Facility Selection Example 1 {\n \"trip_properties\": {\n \"route_id\": [\n \"1234\"\n ],\n \"bikes_allowed\": \"1\"\n },\n \"route_properties\": {\n \"agency_id\": [\n \"2\"\n ]\n },\n \"timespans\": [\n [\n \"06:00:00\",\n \"09:00:00\"\n ]\n ]\n}\n
Transit Service Facility Selection Example 2 {\n \"trip_properties\": {\n \"route_id\": [\n \"4321\"\n ]\n },\n \"route_properties\": {\n \"agency_id\": [\n \"1\"\n ]\n },\n \"timespans\": [\n [\n \"06:00:00\",\n \"09:00:00\"\n ],\n [\n \"15:00:00\",\n \"18:00:00\"\n ]\n ]\n}\n
Transit Service Facility Selection Example 3 {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ],\n \"require\": \"all\"\n }\n}\n
Transit Service Facility Selection Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"title\": \"Transit Service Facility Selection\",\n \"examples\": [\n {\n \"trip_properties\": {\n \"route_id\": [\n \"1234\"\n ],\n \"bikes_allowed\": \"1\"\n },\n \"route_properties\": {\n \"agency_id\": [\n \"2\"\n ]\n },\n \"timespans\": [\n [\n \"06:00:00\",\n \"09:00:00\"\n ]\n ]\n },\n {\n \"trip_properties\": {\n \"route_id\": [\n \"4321\"\n ]\n },\n \"route_properties\": {\n \"agency_id\": [\n \"1\"\n ]\n },\n \"timespans\": [\n [\n \"06:00:00\",\n \"09:00:00\"\n ],\n [\n \"15:00:00\",\n \"18:00:00\"\n ]\n ]\n },\n {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ],\n \"require\": \"all\"\n }\n }\n ],\n \"properties\": {\n \"trip_properties\": {\n \"$ref\": \"select_trip_properties.json\"\n },\n \"route_properties\": {\n \"$ref\": \"select_route_properties.json\"\n },\n \"timespans\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../../defs/timespan.json\"\n },\n \"minItems\": 1\n },\n \"nodes\": {\n \"$ref\": \"select_nodes.json\"\n }\n }\n}\n
"},{"location":"json-schemas/#transitselectionselect_trip_propertiesjson","title":"transit.selection.select_trip_properties.json","text":"Type: Object
Additional Information:
-
description: Selection properties for transit trips.
-
additionalProperties: True
Properties:
Property Type Description Restrictions trip_id
array
of Any
items. - shape_id
array
of Any
items. - direction_id
../transit_trip.json#/$defs/direction_id
- service_id
array
of Any
items. - route_id
array
of Any
items. - trip_short_name
array
of Any
items. - select_trip_properties
Example 1 {\n \"trip_id\": [\n \"1\",\n \"2\"\n ],\n \"direction_id\": 0\n}\n
select_trip_properties
Example 2 {\n \"shape_id\": [\n \"1\",\n \"2\"\n ]\n}\n
select_trip_properties
Example 3 {\n \"service_id\": [\n \"1\",\n \"2\"\n ],\n \"route_id\": [\n \"1\",\n \"2\"\n ]\n}\n
select_trip_properties
Example 4 {\n \"trip_short_name\": [\n \"1\",\n \"2\"\n ]\n}\n
select_trip_properties
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Selection properties for transit trips.\",\n \"type\": \"object\",\n \"additionalProperties\": true,\n \"examples\": [\n {\n \"trip_id\": [\n \"1\",\n \"2\"\n ],\n \"direction_id\": 0\n },\n {\n \"shape_id\": [\n \"1\",\n \"2\"\n ]\n },\n {\n \"service_id\": [\n \"1\",\n \"2\"\n ],\n \"route_id\": [\n \"1\",\n \"2\"\n ]\n },\n {\n \"trip_short_name\": [\n \"1\",\n \"2\"\n ]\n }\n ],\n \"properties\": {\n \"trip_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_trip.json#/$defs/trip_id\"\n }\n },\n \"shape_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_trip.json#/$defs/shape_id\"\n }\n },\n \"direction_id\": {\n \"$ref\": \"../transit_trip.json#/$defs/direction_id\"\n },\n \"service_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_trip.json#/$defs/service_id\"\n }\n },\n \"route_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_route.json#/$defs/route_id\"\n }\n },\n \"trip_short_name\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_trip.json#/$defs/trip_short_name\"\n }\n }\n }\n}\n
"},{"location":"json-schemas/#transitselectionselect_nodesjson","title":"transit.selection.select_nodes.json","text":"Type: Object
Additional Information:
-
description: requirements for describing multiple transit nodes of a project card (e.g. to delete).
-
additionalProperties: False
-
title: Transit network nodes
Properties:
Property Type Description Restrictions stop_id
array
of Any
items. - model_node_id
array
of Any
items. - require
string
- Enumeration: any
,all
One Of:
- {\u201crequired\u201d: [\u201cstop_id\u201d]}
- {\u201crequired\u201d: [\u201cmodel_node_id\u201d]}
Transit network nodes Example 1 {\n \"stop_id\": [\n \"stop1\",\n \"stop2\"\n ],\n \"require\": \"any\"\n}\n
Transit network nodes Example 2 {\n \"model_node_id\": [\n 1,\n 2\n ],\n \"require\": \"all\"\n}\n
Transit network nodes Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"requirements for describing multiple transit nodes of a project card (e.g. to delete).\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"title\": \"Transit network nodes\",\n \"oneOf\": [\n {\n \"required\": [\n \"stop_id\"\n ]\n },\n {\n \"required\": [\n \"model_node_id\"\n ]\n }\n ],\n \"examples\": [\n {\n \"stop_id\": [\n \"stop1\",\n \"stop2\"\n ],\n \"require\": \"any\"\n },\n {\n \"model_node_id\": [\n 1,\n 2\n ],\n \"require\": \"all\"\n }\n ],\n \"properties\": {\n \"stop_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_stop.json#/$defs/stop_id\"\n }\n },\n \"model_node_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../../roadway/roadway_node.json#/$defs/model_node_id\"\n }\n },\n \"require\": {\n \"type\": \"string\",\n \"enum\": [\n \"any\",\n \"all\"\n ]\n }\n }\n}\n
"}]}
\ No newline at end of file
+{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Project Cards","text":"Project Cards represent information about a tranportation infrastructure projects sufficient for usage in a regional travel demand model. The dream is that by coding a project once(ish) in a project card, it can be re-used over and over again in various scenarios \u2013 and even be shared across agencies.
"},{"location":"#schema","title":"Schema","text":"The ProjectCard schema is represented as a json-schema in the /schema
directory. More details: json-schemas page.
The rendering of json-schema leaves a wee bit to be desired, so you might prefer revieweing the schema in datamodels.
"},{"location":"#data-model","title":"Data Model","text":"If you are working in a python environment, you might find it easier to use the pydantic data models which are synced to the json-schema. More details: datamodels page.
"},{"location":"#example-data","title":"Example Data","text":"Example project cards can be found in the /examples
directory and on the examples page as well as within the datamodels documentation.
"},{"location":"#basic-usage","title":"Basic Usage","text":"This package should generally be used to validate or update project cards.
There is also a limited object model, ProjectCard
and Python API which can be used to read and write project cards.
"},{"location":"#command-line","title":"Command Line","text":"Validate project card(s) from a directory or specific file path, optionally filtering by a tag.
validate_card card_search_dir --filter_tags ['tag_to_search_for']\n
Update older project card(s) to current format from a directory or specific file path. Cards should still be validated afterwards.
update_projectcard_schema card_search_dir output_dir\n
"},{"location":"#python-api","title":"Python API","text":"from projectcard.io import read_cards\n\n# Read in cards from a directory with the tag \"Baseline 2030\"\nproject_cards = read_cards(directory, filter_tags=[\"Baseline2030\"])\n\n# Iterate through a deck of cards for validity\nfor project_name,card in project_cards.items():\n print(f\"{project_name}: {card.valid}\")\n\n# Print out a summary of the card with the project name \"4th Ave Busway\"\nprint(project_cards[\"4th Ave Busway\"])\n
For more examples and detail, pleae see the API page.
"},{"location":"#installation","title":"Installation","text":"pip install projectcard\n
Note
It is not generally necessary to install the projectcard package yourself unless you are using it to do independent validation of project cards. Projects such as network_wrangler
that use the projectcard
package to validate project cards usually include projectcard
as a requirement and install it on their own.
Plan on developing in network wrangler?
You might want to follow the directions in the development documentation.
"},{"location":"#companion-software","title":"Companion Software","text":"NetworkWrangler: While ProjectCard can stand alone, it was initially developed to be used with the NetworkWrangler network scenario management software.
ProjectCardRegistry: Example project card registries can be useful for storing collections of project cards, tracking their changes, and making sure project names are not duplicated.
"},{"location":"#having-an-issue","title":"Having an issue?","text":"\ud83e\udeb2 ProjectCard may contain bugs.
\ud83e\udd14 Also, since it has primarily been used by its developers, the documentation may contain some omissions or not be entirely clear.
But we\u2019d love to make it better! Please report bugs or incorrect/unclear/missing documentation with a GitHub Issue - or fix them yourself with a pull request!
"},{"location":"#who-dat","title":"Who-dat?","text":"ProjectCard was developed using resources from the Metropolitan Transportation Commission, Metropolitan Council MN, and in-kind time from UrbanLabs LLC and WSP. It is currently maintained using in-kind time\u2026so please be patient.
"},{"location":"#release-history","title":"Release History","text":"Notable changes and version history.
Version Date Comment v0.3.1 2024-10-07 Improved resilience of read_cards()
including ability to handle relative paths. v0.3.0 2024-09-27 Added transit addition and deletion change types. v0.2.0 2024-09-08 Read cards from nested folders. v0.1.2 2024-08-05 - v0.1.1 2024-06-20 Initial release on PyPI"},{"location":"api/","title":"API","text":""},{"location":"api/#basic-usage","title":"Basic Usage","text":"from projectcard.io import read_cards\n\n# Read in cards from a directory with the tag \"Baseline 2030\"\nproject_cards = read_cards(directory, filter_tags=[\"Baseline2030\"])\n\n# Iterate through a deck of cards for validity\nfor project_name,card in project_cards.items():\n print(f\"{project_name}: {card.valid}\")\n\n# Print out a summary of the card with the project name \"4th Ave Busway\"\nprint(project_cards[\"4th Ave Busway\"])\n
Project Card class for project card data schema.
Functions for reading and writing project cards.
Validates ProjectCard JSON data against a JSON schema.
"},{"location":"api/#projectcard.projectcard.ProjectCard","title":"ProjectCard
","text":"Representation of a Project Card.
Attributes:
Name Type Description __dict__
Dictionary of project card attributes
project
Name of project
dependencies
dict
Dependencies of project
tags
list[str]
Tags of project
notes
str
Notes about project
valid
bool
Boolean indicating if data conforms to project card data schema
facilities
list[dict]
List of all facility objects in project card
facility
Union[str, dict]
either singular facility in project card or the string \u201cmultiple\u201d
all_property_changes
Union[str, dict]
List of all property_changes objects in project card
property_changes
Union[str, dict]
either singular property_changes in project card or the string \u201cmultiple\u201d
change_types
list[str]
List of all project types in project card
change_type
str
either singular project type in project card or the string \u201cmultiple\u201d
sub_projects
str
list of sub_project objects
Source code in projectcard/projectcard.py
class ProjectCard:\n \"\"\"Representation of a Project Card.\n\n Attributes:\n __dict__: Dictionary of project card attributes\n project: Name of project\n dependencies: Dependencies of project\n tags: Tags of project\n notes: Notes about project\n valid: Boolean indicating if data conforms to project card data schema\n facilities: List of all facility objects in project card\n facility: either singular facility in project card or the string \"multiple\"\n all_property_changes: List of all property_changes objects in project card\n property_changes: either singular property_changes in project card or the string \"multiple\"\n change_types: List of all project types in project card\n change_type: either singular project type in project card or the string \"multiple\"\n sub_projects: list of sub_project objects\n \"\"\"\n\n def __init__(self, attribute_dictonary: dict, use_defaults: bool = True):\n \"\"\"Constructor for ProjectCard object.\n\n Args:\n attribute_dictonary: a nested dictionary of attributes\n use_defaults: if True, will use default values for missing required attributes,\n if exist in schema. Defaults to True.\n \"\"\"\n # add these first so they are first on write out\n self.tags: list[str] = []\n self.dependencies: dict = {}\n self.notes: str = \"\"\n self._sub_projects: list[SubProject] = []\n if use_defaults:\n attribute_dictonary = update_dict_with_schema_defaults(attribute_dictonary)\n self.__dict__.update(attribute_dictonary)\n for sp in self.__dict__.get(\"changes\", []):\n sp_obj = SubProject(sp, self)\n self._sub_projects.append(sp_obj)\n\n def __str__(self):\n \"\"\"String representation of project card.\"\"\"\n s = [f\"{key}: {value}\" for key, value in self.__dict__.items()]\n return \"\\n\".join(s)\n\n def validate(self) -> bool:\n \"\"\"Return True if project card is valid, False otherwise.\"\"\"\n return validate_card(self.__dict__)\n\n @property\n def to_dict(self) -> dict:\n \"\"\"Return dictionary of public project card attributes.\"\"\"\n return {k: v for k, v in self.__dict__.items() if not k.startswith(\"_\") and v is not None}\n\n @property\n def valid(self) -> bool:\n \"\"\"Return True if project card is valid, False otherwise.\"\"\"\n try:\n self.validate()\n except ProjectCardValidationError as e:\n CardLogger.error(f\"Project {self.project} is not valid: {e}\")\n return False\n return True\n\n @property\n def facilities(self) -> list[dict]:\n \"\"\"Return all facilities from project card as list of dicts.\"\"\"\n if any(\"transit\" in t for t in self.change_types):\n CardLogger.warning(\"Transit project doesn't have services.\")\n return []\n f = list(_findkeys(self.__dict__, \"facility\"))\n if not f:\n msg = f\"Couldn't find facility in project card {self.project}\"\n raise ProjectCardValidationError(msg)\n return f\n\n @property\n def facility(self) -> Union[str, dict]:\n \"\"\"Return facility part of project card or \"multiple\" if more than one.\"\"\"\n f = self.facilities\n if len(f) > 1:\n return \"multiple\"\n return f[0]\n\n @property\n def services(self) -> list[dict]:\n \"\"\"Return all services from project card as list of dicts.\"\"\"\n if any(\"roadway\" in t for t in self.change_types):\n CardLogger.warning(\"Roadway project doesn't have services.\")\n return []\n s = list(_findkeys(self.__dict__, \"service\"))\n if not s:\n msg = f\"Couldn't find service in project card {self.project}\"\n raise ProjectCardValidationError(msg)\n return s\n\n @property\n def service(self) -> Union[str, dict]:\n \"\"\"Return service part of from project card or \"multiple\" if more than one.\"\"\"\n s = self.services\n if len(s) > 1:\n return \"multiple\"\n return s[0]\n\n @property\n def all_transit_property_changes(self) -> list[dict]:\n \"\"\"Return all transit property changes from project card.\"\"\"\n if not any(\"transit_property_change\" in t for t in self.change_types):\n CardLogger.warning(f\"Project {self.project} doesn't have transit property changes.\")\n return []\n tp = list(_findkeys(self.__dict__, \"transit_property_change\"))\n p = [i[\"property_changes\"] for i in tp]\n return p\n\n @property\n def transit_property_change(self) -> Union[str, dict]:\n \"\"\"Return transit property change from project card or \"multiple if more than one.\"\"\"\n p = self.all_transit_property_changes\n if len(p) > 1:\n return \"multiple\"\n return p[0]\n\n @property\n def all_transit_routing_changes(self) -> list[dict]:\n \"\"\"Return all transit routing changes from project card.\"\"\"\n if not any(\"transit_routing_change\" in t for t in self.change_types):\n CardLogger.warning(f\"Project {self.project} doesn't have routing changes.\")\n return []\n r = list(_findkeys(self.__dict__, \"routing\"))\n CardLogger.debug(f\"transit routing change: {r}\")\n return r\n\n @property\n def transit_routing_change(self) -> Union[str, dict]:\n \"\"\"Return transit routing change from project card.\"\"\"\n p = self.all_transit_routing_changes\n if len(p) > 1:\n return \"multiple\"\n return p[0]\n\n @property\n def change_types(self) -> list[str]:\n \"\"\"Returns list of all change types from project/subproject.\"\"\"\n if self._sub_projects:\n return [sp.change_type for sp in self._sub_projects]\n\n type_keys = [k for k in self.__dict__ if k in CHANGE_TYPES]\n if not type_keys:\n msg = f\"Couldn't find type of project card {self.project}\"\n raise ProjectCardValidationError(msg)\n return type_keys\n\n @property\n def change_type(self) -> str:\n \"\"\"Return single change type if single project or \"multiple\" if >1 subproject.\"\"\"\n t = self.change_types\n if len(t) > 1:\n return \"multiple\"\n return t[0]\n
"},{"location":"api/#projectcard.projectcard.ProjectCard.all_transit_property_changes","title":"all_transit_property_changes: list[dict]
property
","text":"Return all transit property changes from project card.
"},{"location":"api/#projectcard.projectcard.ProjectCard.all_transit_routing_changes","title":"all_transit_routing_changes: list[dict]
property
","text":"Return all transit routing changes from project card.
"},{"location":"api/#projectcard.projectcard.ProjectCard.change_type","title":"change_type: str
property
","text":"Return single change type if single project or \u201cmultiple\u201d if >1 subproject.
"},{"location":"api/#projectcard.projectcard.ProjectCard.change_types","title":"change_types: list[str]
property
","text":"Returns list of all change types from project/subproject.
"},{"location":"api/#projectcard.projectcard.ProjectCard.facilities","title":"facilities: list[dict]
property
","text":"Return all facilities from project card as list of dicts.
"},{"location":"api/#projectcard.projectcard.ProjectCard.facility","title":"facility: Union[str, dict]
property
","text":"Return facility part of project card or \u201cmultiple\u201d if more than one.
"},{"location":"api/#projectcard.projectcard.ProjectCard.service","title":"service: Union[str, dict]
property
","text":"Return service part of from project card or \u201cmultiple\u201d if more than one.
"},{"location":"api/#projectcard.projectcard.ProjectCard.services","title":"services: list[dict]
property
","text":"Return all services from project card as list of dicts.
"},{"location":"api/#projectcard.projectcard.ProjectCard.to_dict","title":"to_dict: dict
property
","text":"Return dictionary of public project card attributes.
"},{"location":"api/#projectcard.projectcard.ProjectCard.transit_property_change","title":"transit_property_change: Union[str, dict]
property
","text":"Return transit property change from project card or \u201cmultiple if more than one.
"},{"location":"api/#projectcard.projectcard.ProjectCard.transit_routing_change","title":"transit_routing_change: Union[str, dict]
property
","text":"Return transit routing change from project card.
"},{"location":"api/#projectcard.projectcard.ProjectCard.valid","title":"valid: bool
property
","text":"Return True if project card is valid, False otherwise.
"},{"location":"api/#projectcard.projectcard.ProjectCard.__init__","title":"__init__(attribute_dictonary, use_defaults=True)
","text":"Constructor for ProjectCard object.
Parameters:
Name Type Description Default attribute_dictonary
dict
a nested dictionary of attributes
required use_defaults
bool
if True, will use default values for missing required attributes, if exist in schema. Defaults to True.
True
Source code in projectcard/projectcard.py
def __init__(self, attribute_dictonary: dict, use_defaults: bool = True):\n \"\"\"Constructor for ProjectCard object.\n\n Args:\n attribute_dictonary: a nested dictionary of attributes\n use_defaults: if True, will use default values for missing required attributes,\n if exist in schema. Defaults to True.\n \"\"\"\n # add these first so they are first on write out\n self.tags: list[str] = []\n self.dependencies: dict = {}\n self.notes: str = \"\"\n self._sub_projects: list[SubProject] = []\n if use_defaults:\n attribute_dictonary = update_dict_with_schema_defaults(attribute_dictonary)\n self.__dict__.update(attribute_dictonary)\n for sp in self.__dict__.get(\"changes\", []):\n sp_obj = SubProject(sp, self)\n self._sub_projects.append(sp_obj)\n
"},{"location":"api/#projectcard.projectcard.ProjectCard.__str__","title":"__str__()
","text":"String representation of project card.
Source code in projectcard/projectcard.py
def __str__(self):\n \"\"\"String representation of project card.\"\"\"\n s = [f\"{key}: {value}\" for key, value in self.__dict__.items()]\n return \"\\n\".join(s)\n
"},{"location":"api/#projectcard.projectcard.ProjectCard.validate","title":"validate()
","text":"Return True if project card is valid, False otherwise.
Source code in projectcard/projectcard.py
def validate(self) -> bool:\n \"\"\"Return True if project card is valid, False otherwise.\"\"\"\n return validate_card(self.__dict__)\n
"},{"location":"api/#projectcard.projectcard.SubProject","title":"SubProject
","text":"Representation of a SubProject within a ProjectCard.
Attributes:
Name Type Description parent_project
ProjectCard
reference to parent ProjectCard object
type
ProjectCard
project type
tags
list[str]
reference to parent project card tags
dependencies
dict
reference to parent project card\u2019s dependencies
project
str
reference to the name of the parent project card\u2019s name
facility
dict
facility selection dictionary
property_changes
dict
property_changes dictionary
Source code in projectcard/projectcard.py
class SubProject:\n \"\"\"Representation of a SubProject within a ProjectCard.\n\n Attributes:\n parent_project: reference to parent ProjectCard object\n type: project type\n tags: reference to parent project card tags\n dependencies: reference to parent project card's dependencies\n project: reference to the name of the parent project card's name\n facility: facility selection dictionary\n property_changes:property_changes dictionary\n \"\"\"\n\n def __init__(self, sp_dictionary: dict, parent_project: ProjectCard):\n \"\"\"Constructor for SubProject object.\n\n Args:\n sp_dictionary (dict): dictionary of sub-project attributes contained within \"changes\"\n list of parent projet card\n parent_project (ProjectCard): ProjectCard object for parent project card\n\n \"\"\"\n self._parent_project = parent_project\n\n if len(sp_dictionary) != 1:\n msg = f\"Subproject of {parent_project.project} should only have one change. Found {len(sp_dictionary)} changes.\"\n CardLogger.error(\n msg\n + f\" Did you forget to indent the rest of this change?\\nKeys: {sp_dictionary.keys()}\"\n )\n raise SubprojectValidationError(msg)\n self._change_type = next(iter(sp_dictionary.keys()))\n self.__dict__.update(sp_dictionary)\n self._sub_projects: list[SubProject] = []\n\n @property\n def change_type(self) -> str:\n \"\"\"Return change type from subproject.\"\"\"\n return self._change_type\n\n @property\n def parent_project(self) -> ProjectCard:\n \"\"\"Return parent project from parent project card.\"\"\"\n return self._parent_project\n\n @property\n def project(self) -> str:\n \"\"\"Return project name from parent project card.\"\"\"\n return self._parent_project.project\n\n @property\n def dependencies(self) -> dict:\n \"\"\"Return dependencies from parent project card.\"\"\"\n return self._parent_project.dependencies\n\n @property\n def tags(self) -> list[str]:\n \"\"\"Return tags from parent project card.\"\"\"\n return self._parent_project.tags\n\n @property\n def facility(self) -> dict:\n \"\"\"Return facility dictionary from subproject.\"\"\"\n f = list(_findkeys(self.__dict__, \"facility\"))\n if not f:\n msg = f\"Couldn't find facility in subproject in project card {self._parent_project.project}\"\n raise SubprojectValidationError(msg)\n return f[0]\n\n @property\n def valid(self) -> bool:\n \"\"\"Check if subproject is valid.\"\"\"\n return self._parent_project.valid\n
"},{"location":"api/#projectcard.projectcard.SubProject.change_type","title":"change_type: str
property
","text":"Return change type from subproject.
"},{"location":"api/#projectcard.projectcard.SubProject.dependencies","title":"dependencies: dict
property
","text":"Return dependencies from parent project card.
"},{"location":"api/#projectcard.projectcard.SubProject.facility","title":"facility: dict
property
","text":"Return facility dictionary from subproject.
"},{"location":"api/#projectcard.projectcard.SubProject.parent_project","title":"parent_project: ProjectCard
property
","text":"Return parent project from parent project card.
"},{"location":"api/#projectcard.projectcard.SubProject.project","title":"project: str
property
","text":"Return project name from parent project card.
"},{"location":"api/#projectcard.projectcard.SubProject.tags","title":"tags: list[str]
property
","text":"Return tags from parent project card.
"},{"location":"api/#projectcard.projectcard.SubProject.valid","title":"valid: bool
property
","text":"Check if subproject is valid.
"},{"location":"api/#projectcard.projectcard.SubProject.__init__","title":"__init__(sp_dictionary, parent_project)
","text":"Constructor for SubProject object.
Parameters:
Name Type Description Default sp_dictionary
dict
dictionary of sub-project attributes contained within \u201cchanges\u201d list of parent projet card
required parent_project
ProjectCard
ProjectCard object for parent project card
required Source code in projectcard/projectcard.py
def __init__(self, sp_dictionary: dict, parent_project: ProjectCard):\n \"\"\"Constructor for SubProject object.\n\n Args:\n sp_dictionary (dict): dictionary of sub-project attributes contained within \"changes\"\n list of parent projet card\n parent_project (ProjectCard): ProjectCard object for parent project card\n\n \"\"\"\n self._parent_project = parent_project\n\n if len(sp_dictionary) != 1:\n msg = f\"Subproject of {parent_project.project} should only have one change. Found {len(sp_dictionary)} changes.\"\n CardLogger.error(\n msg\n + f\" Did you forget to indent the rest of this change?\\nKeys: {sp_dictionary.keys()}\"\n )\n raise SubprojectValidationError(msg)\n self._change_type = next(iter(sp_dictionary.keys()))\n self.__dict__.update(sp_dictionary)\n self._sub_projects: list[SubProject] = []\n
"},{"location":"api/#projectcard.io.dict_to_yaml_with_comments","title":"dict_to_yaml_with_comments(d)
","text":"Converts a dictionary to a YAML string with comments.
Source code in projectcard/io.py
def dict_to_yaml_with_comments(d):\n \"\"\"Converts a dictionary to a YAML string with comments.\"\"\"\n yaml_str = yaml.dump(d, default_flow_style=False, sort_keys=False)\n yaml_lines = yaml_str.splitlines()\n final_yaml_lines = []\n\n for line in yaml_lines:\n if \"#\" in line:\n final_yaml_lines.append(f\"#{line}\")\n else:\n final_yaml_lines.append(line)\n\n return \"\\n\".join(final_yaml_lines)\n
"},{"location":"api/#projectcard.io.read_card","title":"read_card(filepath, validate=False)
","text":"Read single project card from a path and return project card object.
Parameters:
Name Type Description Default filepath
ProjectCardFilepath
file where the project card is.
required validate
bool
if True, will validate the project card schemea
False
Source code in projectcard/io.py
def read_card(filepath: ProjectCardFilepath, validate: bool = False):\n \"\"\"Read single project card from a path and return project card object.\n\n Args:\n filepath: file where the project card is.\n validate: if True, will validate the project card schemea\n \"\"\"\n if not Path(filepath).is_file():\n msg = f\"Cannot find project card file: {filepath}\"\n raise FileNotFoundError(msg)\n card_dict = read_cards(filepath)\n card = next(iter(card_dict.values()))\n if validate:\n card.validate()\n return card\n
"},{"location":"api/#projectcard.io.read_cards","title":"read_cards(filepath, filter_tags=None, recursive=False, base_path=DEFAULT_BASE_PATH, existing_projects=None)
","text":"Reads collection of project card files by inferring the file type.
Lowercases all keys, but then replaces any that need to be uppercased using the REPLACE_KEYS mapping. Needed to keep \u201cA\u201d and \u201cB\u201d uppercased.
If a path is given as a relative path, it will be resolved to an absolute path using the base_path.
Parameters:
Name Type Description Default filepath
ProjectCardFilepaths
where the project card is. A single path, list of paths, a directory, or a glob pattern.
required filter_tags
Optional[list[str]]
list of tags to filter by.
None
recursive
bool
if True, will search recursively in subdirs.
False
base_path
Path
base path to resolve relative paths from. Defaults to current working directory.
DEFAULT_BASE_PATH
existing_projects
Optional[list[str]]
list of existing project names to check for uniqueness.
None
Source code in projectcard/io.py
def read_cards(\n filepath: ProjectCardFilepaths,\n filter_tags: Optional[list[str]] = None,\n recursive: bool = False,\n base_path: Path = DEFAULT_BASE_PATH,\n existing_projects: Optional[list[str]] = None,\n) -> dict[str, ProjectCard]:\n \"\"\"Reads collection of project card files by inferring the file type.\n\n Lowercases all keys, but then replaces any that need to be uppercased using the\n REPLACE_KEYS mapping. Needed to keep \"A\" and \"B\" uppercased.\n\n If a path is given as a relative path, it will be resolved to an absolute path using\n the base_path.\n\n Args:\n filepath: where the project card is. A single path, list of paths,\n a directory, or a glob pattern.\n filter_tags: list of tags to filter by.\n recursive: if True, will search recursively in subdirs.\n base_path: base path to resolve relative paths from. Defaults to current working directory.\n existing_projects: list of existing project names to check for uniqueness.\n\n Returns: dictionary of project cards by project name\n \"\"\"\n CardLogger.debug(f\"Reading cards from {filepath}.\")\n filter_tags = filter_tags or []\n filter_tags = list(map(str.lower, filter_tags))\n cards = {}\n\n filepath = _resolve_rel_paths(filepath, base_path=base_path)\n if isinstance(filepath, list) or filepath.is_dir():\n card_paths = _get_cardpath_list(filepath, valid_ext=VALID_EXT, recursive=recursive)\n for p in card_paths:\n project_card = _read_card(\n p, filter_tags=filter_tags, existing_projects=existing_projects\n )\n if project_card is None:\n continue\n if project_card.project in cards:\n msg = f\"Project names not unique from projects being read in together in `read_cards()`: {project_card.project}\"\n raise ProjectCardReadError(msg)\n cards[project_card.project] = project_card\n else:\n project_card = _read_card(\n filepath, filter_tags=filter_tags, existing_projects=existing_projects\n )\n if project_card is not None:\n cards[project_card.project] = project_card\n if len(cards) == 0:\n CardLogger.warning(\"No project cards found with given parameters.\")\n return cards\n
"},{"location":"api/#projectcard.io.write_card","title":"write_card(project_card, filename=None)
","text":"Writes project card dictionary to YAML file.
Source code in projectcard/io.py
def write_card(project_card, filename: Optional[Path] = None):\n \"\"\"Writes project card dictionary to YAML file.\"\"\"\n from .utils import make_slug\n\n default_filename = make_slug(project_card.project) + \".yml\"\n filename = filename or Path(default_filename)\n\n if not project_card.valid:\n CardLogger.warning(f\"{project_card.project} Project Card not valid.\")\n out_dict: dict[str, Any] = {}\n\n # Writing these first manually so that they are at top of file\n out_dict[\"project\"] = None\n if project_card.to_dict.get(\"tags\"):\n out_dict[\"tags\"] = None\n if project_card.to_dict.get(\"dependencies\"):\n out_dict[\"dependencies\"] = None\n out_dict.update(project_card.to_dict)\n for k in SKIP_WRITE:\n if k in out_dict:\n del out_dict[k]\n\n yaml_content = dict_to_yaml_with_comments(out_dict)\n\n with filename.open(\"w\") as outfile:\n outfile.write(yaml_content)\n\n CardLogger.info(f\"Wrote project card to: {filename}\")\n
"},{"location":"api/#projectcard.validate.package_schema","title":"package_schema(schema_path=PROJECTCARD_SCHEMA, outfile_path=None)
","text":"Consolidates referenced schemas into a single schema and writes it out.
Parameters:
Name Type Description Default schema_path
Union[Path, str]
Schema to read int and package. Defaults to PROJECTCARD_SCHEMA which is ROOTDIR / \u201cschema\u201d / \u201cprojectcard.json\u201d.
PROJECTCARD_SCHEMA
outfile_path
Optional[Union[Path, str]]
Where to write out packaged schema. Defaults to schema_path.basepath.packaged.json
None
Source code in projectcard/validate.py
def package_schema(\n schema_path: Union[Path, str] = PROJECTCARD_SCHEMA,\n outfile_path: Optional[Union[Path, str]] = None,\n) -> None:\n \"\"\"Consolidates referenced schemas into a single schema and writes it out.\n\n Args:\n schema_path: Schema to read int and package. Defaults to PROJECTCARD_SCHEMA which is\n ROOTDIR / \"schema\" / \"projectcard.json\".\n outfile_path: Where to write out packaged schema. Defaults\n to schema_path.basepath.packaged.json\n \"\"\"\n schema_path = Path(schema_path)\n _s_data = _load_schema(schema_path)\n default_outfile_path = schema_path.parent / f\"{schema_path.stem}packaged.{schema_path.suffix}\"\n outfile_path = outfile_path or default_outfile_path\n outfile_path = Path(outfile_path)\n with outfile_path.open(\"w\") as outfile:\n json.dump(_s_data, outfile, indent=4)\n CardLogger.info(f\"Wrote {schema_path.stem} to {outfile_path.stem}\")\n
"},{"location":"api/#projectcard.validate.update_dict_with_schema_defaults","title":"update_dict_with_schema_defaults(data, schema=PROJECTCARD_SCHEMA)
","text":"Recursively update missing required properties with default values.
Parameters:
Name Type Description Default data
dict
The data dictionary to update.
required schema
Union[Path, dict]
The schema dictionary or path to the schema file.
PROJECTCARD_SCHEMA
Returns:
Type Description dict
The updated data dictionary.
Source code in projectcard/validate.py
def update_dict_with_schema_defaults(\n data: dict, schema: Union[Path, dict] = PROJECTCARD_SCHEMA\n) -> dict:\n \"\"\"Recursively update missing required properties with default values.\n\n Args:\n data: The data dictionary to update.\n schema: The schema dictionary or path to the schema file.\n\n Returns:\n The updated data dictionary.\n \"\"\"\n if isinstance(schema, (str, Path)):\n schema = _load_schema(schema)\n\n if \"properties\" in schema:\n for prop_name, schema_part in schema[\"properties\"].items():\n # Only update if the property is required, has a default, and is not already there\n if (\n prop_name not in data\n and \"default\" in schema_part\n and prop_name in schema.get(\"required\", [])\n ):\n CardLogger.debug(f\"Adding default value for {prop_name}: {schema_part['default']}\")\n data[prop_name] = schema_part[\"default\"]\n elif (\n prop_name in data\n and isinstance(data[prop_name], dict)\n and \"properties\" in schema_part\n ):\n data[prop_name] = update_dict_with_schema_defaults(data[prop_name], schema_part)\n elif (\n prop_name in data and isinstance(data[prop_name], list) and \"items\" in schema_part\n ):\n for item in data[prop_name]:\n if isinstance(item, dict):\n update_dict_with_schema_defaults(item, schema_part[\"items\"])\n return data\n
"},{"location":"api/#projectcard.validate.validate_card","title":"validate_card(jsondata, schema_path=PROJECTCARD_SCHEMA, parse_defaults=True)
","text":"Validates json-like data to specified schema.
If pycode
key exists, will evaluate it for basic runtime errors using Flake8. Note: will not flag any invalid use of RoadwayNetwork or TransitNetwork APIs.
Parameters:
Name Type Description Default jsondata
dict
json-like data to validate.
required schema_path
Path
path to schema to validate to. Defaults to PROJECTCARD_SCHEMA which is ROOTDIR / \u201cschema\u201d / \u201cprojectcard.json\u201d
PROJECTCARD_SCHEMA
parse_defaults
bool
if True, will use default values for missing required attributes.
True
Raises:
Type Description ValidationError
If jsondata doesn\u2019t conform to specified schema.
SchemaError
If schema itself is not valid.
Source code in projectcard/validate.py
def validate_card(\n jsondata: dict, schema_path: Path = PROJECTCARD_SCHEMA, parse_defaults: bool = True\n) -> bool:\n \"\"\"Validates json-like data to specified schema.\n\n If `pycode` key exists, will evaluate it for basic runtime errors using Flake8.\n Note: will not flag any invalid use of RoadwayNetwork or TransitNetwork APIs.\n\n Args:\n jsondata: json-like data to validate.\n schema_path: path to schema to validate to.\n Defaults to PROJECTCARD_SCHEMA which is\n ROOTDIR / \"schema\" / \"projectcard.json\"\n parse_defaults: if True, will use default values for missing required attributes.\n\n Raises:\n ValidationError: If jsondata doesn't conform to specified schema.\n SchemaError: If schema itself is not valid.\n \"\"\"\n if \"project\" in jsondata:\n CardLogger.debug(f\"Validating: {jsondata['project']}\")\n try:\n _schema_data = _load_schema(schema_path)\n if parse_defaults:\n jsondata = update_dict_with_schema_defaults(jsondata, _schema_data)\n validate(jsondata, schema=_schema_data)\n except ValidationError as e:\n CardLogger.error(f\"---- Error validating {jsondata['project']} ----\")\n msg = f\"\\nRelevant schema: {e.schema}\\nValidator Value: {e.validator_value}\\nValidator: {e.validator}\"\n msg += f\"\\nabsolute_schema_path:{e.absolute_schema_path}\\nabsolute_path:{e.absolute_path}\"\n CardLogger.error(msg)\n raise ProjectCardValidationError from e\n except SchemaError as e:\n CardLogger.error(e)\n raise ProjectCardJSONSchemaError from e\n\n if \"pycode\" in jsondata:\n if \"self.\" in jsondata[\"pycode\"] and \"self_obj_type\" not in jsondata:\n msg = \"If using self, must specify what `self` refers to in yml frontmatter using self_obj_type: <RoadwayNetwork|TransitNetwork>\"\n raise PycodeError(msg)\n _validate_pycode(jsondata)\n\n return True\n
"},{"location":"api/#projectcard.validate.validate_schema_file","title":"validate_schema_file(schema_path=PROJECTCARD_SCHEMA)
","text":"Validates that a schema file is a valid JSON-schema.
Parameters:
Name Type Description Default schema_path
Path
description. Defaults to PROJECTCARD_SCHEMA which is ROOTDIR / \u201cschema\u201d / \u201cprojectcard.json\u201d.
PROJECTCARD_SCHEMA
Source code in projectcard/validate.py
def validate_schema_file(schema_path: Path = PROJECTCARD_SCHEMA) -> bool:\n \"\"\"Validates that a schema file is a valid JSON-schema.\n\n Args:\n schema_path: _description_. Defaults to PROJECTCARD_SCHEMA which is\n ROOTDIR / \"schema\" / \"projectcard.json\".\n \"\"\"\n try:\n _schema_data = _load_schema(schema_path)\n # _resolver = _ref_resolver(schema_path,_schema_data)\n validate({}, schema=_schema_data) # ,resolver=_resolver)\n except ValidationError:\n pass\n except SchemaError as e:\n CardLogger.error(e)\n raise ProjectCardJSONSchemaError from e\n\n return True\n
"},{"location":"datamodels/","title":"Project Card Data Model","text":"Warning
These models are not the canonical schema and may or may not be completely accurate and up to date \u2013 although we try our best. The canonical schema is maintained in json-schema format and is documented on the schemas page \u2013 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.
"},{"location":"datamodels/#projectcard.models.project.ProjectModel--grouping-related-changes","title":"Grouping Related Changes:","text":"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, \u201cproject\u201d, they should be careful to ensure that the changes are logically related and would likely be implemented together.
"},{"location":"datamodels/#projectcard.models.project.ProjectModel--phased-projects","title":"Phased Projects:","text":"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.
"},{"location":"datamodels/#projectcard.models.project.ProjectModel--dependencies","title":"Dependencies:","text":"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).
"},{"location":"datamodels/#projectcard.models.project.ProjectModel--tags","title":"Tags:","text":"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
.
"},{"location":"datamodels/#projectcard.models.project.ProjectModel--formats-serialization","title":"Formats + Serialization:","text":"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\u2026each of which is a list of project names.
changes
Optional[list[ChangeTypes]]
List of one or more changes. Must either have changes
or a single change type (e.g. roadway_property_change
, transit_property_change
, etc.). If changes
is provided, cannot specify another change outside of changes.
roadway_property_change
Optional[RoadwayPropertyChanges]
A single roadway property change. Cannot be used with changes
or another change type.
roadway_deletion
Optional[RoadwayDeletion]
A single roadway deletion change. Cannot be used with changes
or another change type.
roadway_addition
Optional[RoadwayAddition]
A single roadway addition change. Cannot be used with changes
or another change type.
transit_property_change
Optional[TransitPropertyChange]
A single Transit property change. Cannot be used with changes
or another change type.
transit_routing_change
Optional[TransitRoutingChange]
A single Transit routing change. Cannot be used with changes
or another change type.
transit_service_deletion
Optional[TransitServiceDeletion]
A single Transit service deletion change. Cannot be used with changes
or another change type.
transit_route_addition
Optional[TransitRouteAddition]
A single transit route addition change. Cannot be used with changes
or another change type.
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 changes
or another change type.
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 changes
or another change type.
Example Project Card
project: \"Add new bus route\"\nnotes: \"This project adds a new bus route to the network.\"\ntags: [\"bus\", \"transit\"]\ndependencies:\n conflicts: [\"Remove bus route\"]\n prerequisites: [\"Add bus stop\"]\n corequisites: [\"Add bus route\"]\ntransit_route_addition: ...\n
Source code in projectcard/models/project.py
class ProjectModel(BaseModel):\n \"\"\"ProjectCard Data Model.\n\n ProjectCards are a set of information that describe an infrastructure project or change to a\n network. They are used to document and manage changes to a network such as adding a new bus\n route, changing a roadway property, changing the number of lanes on a roadway, or increasing\n transit service frequency.\n\n ProjectCards are composed of one or more **changes**. Each change is a specific type of change\n that happens to a specific portion, or **selection** of the network, such as a roadway\n property change, transit property change, or transit route addition. Each change type has\n its own set of parameters that describe the change in detail.\n\n #### Grouping Related Changes:\n When more than one change is needed to describe a project, the `changes` field can be used to\n specify a list of changes. This is useful when a project requires multiple changes to be made\n to the network. For example, a project to add a new bus route may require adding new bus lanes\n to the roadway network. Or adding a new, mid-block bus-route may require adding a new bus stop\n as a node in the roadway network and splitting the link.\n\n While the user can choose what changes should be grouped together into a single,\n \"project\", they should be careful to ensure that the changes are logically related and would\n likely be implemented together.\n\n #### Phased Projects:\n In cases where a project maybe implemented in multiple phases, it is recommended to create\n separate project cards for each phase. This will help to ensure that the project can be\n in a network similar to how it would be implemented in the real world.\n\n #### Dependencies:\n If a project requires another project to be implemented first, the `pre-requisites` field\n of `dependencies` can be used. Similarly, if a project would be impossible to implement\n if another project is implemented, the `conflicts` field of `dependencies` can be used.\n `corequisites` can be used to specify projects that must be implemented at the same time -\n noting that if Project A specifies Project B as a corequisite, then Project B need not specify\n Project A as a corequisite (if they were dependent upon each other, then they should likely\n be combined into a single project).\n\n #### Tags:\n Tags can be used to categorize projects and make it easier to search for projects that are\n related to a specific topic or type of project. For example, a collection of projects that are\n considered to be in your committed future baseline because they have committed funding could\n be tagged as `committed`.\n\n #### Formats + Serialization:\n ProjectCards can be represented within memory as any structured data format such as JSON,\n Python Dictionaries, or a Struct. They can also be serialized to any nested file format that\n is compatible with [JSON-schema ](https://json-schema.org) such as YAML, TOML, or JSON.\n For the purposes of this documentation, we will use YAML as the serialization format for\n the examples becuase it is less verbose than JSON and python dictonaries and easier to read.\n\n List of tools that support json-schema: <https://json-schema.org/tools>\n\n Attributes:\n project (str): The name of the project. This name must be unique within a set of projects\n being managed or applied to a network.\n notes (Optional[str]): Additional freeform notes about the project.\n tags (Optional[list[str]]): Tags for the project to associate the project card with a\n specific project or type of project.\n dependencies (Optional[Dependencies]): Dependencies for the project card: conflicts,\n prerequisites, and corequisites...each of which is a list of project names.\n changes (Optional[list[ChangeTypes]]): List of one or more changes. Must either have\n `changes` or a single change type (e.g. `roadway_property_change`,\n `transit_property_change`, etc.). If `changes` is provided, cannot specify another\n change outside of changes.\n roadway_property_change (Optional[RoadwayPropertyChanges]): A single roadway property\n change. Cannot be used with `changes` or another change type.\n roadway_deletion (Optional[RoadwayDeletion]): A single roadway deletion change. Cannot\n be used with `changes` or another change type.\n roadway_addition (Optional[RoadwayAddition]): A single roadway addition change. Cannot\n be used with `changes` or another change type.\n transit_property_change (Optional[TransitPropertyChange]): A single Transit property\n change. Cannot be used with `changes` or another change type.\n transit_routing_change (Optional[TransitRoutingChange]): A single Transit routing change.\n Cannot be used with `changes` or another change type.\n transit_service_deletion (Optional[TransitServiceDeletion]): A single Transit service\n deletion change. Cannot be used with `changes` or another change type.\n transit_route_addition (Optional[TransitRouteAddition]): A single transit route addition\n change. Cannot be used with `changes` or another change type.\n pycode (Optional[str]): A single pycode type change which uses python code for the project\n which refers to self as a transit or roadway network. Cannot be used with `changes` or\n another change type.\n self_obj_type (Optional[Literal[\"RoadwayNetwork\", \"TransitNetwork\"]]): Type of object\n being changed in the pycode python code. Must be either TransitNetwork or\n RoadwayNetwork. Cannot be used with `changes` or another change type.\n\n !!! Example \"Example Project Card\"\n ```yaml\n project: \"Add new bus route\"\n notes: \"This project adds a new bus route to the network.\"\n tags: [\"bus\", \"transit\"]\n dependencies:\n conflicts: [\"Remove bus route\"]\n prerequisites: [\"Add bus stop\"]\n corequisites: [\"Add bus route\"]\n transit_route_addition: ...\n ```\n \"\"\"\n\n require_one_of: ClassVar = [\n \"roadway_property_change\",\n \"roadway_deletion\",\n \"roadway_addition\",\n \"transit_property_change\",\n \"transit_routing_change\",\n \"transit_service_deletion\",\n \"transit_route_addition\",\n [\"pycode\", \"self_obj_type\"],\n \"changes\",\n ]\n\n project: str\n notes: Optional[str]\n tags: Optional[list[str]]\n dependencies: Optional[Dependencies]\n changes: Optional[list[ChangeTypes]]\n roadway_property_change: Optional[RoadwayPropertyChanges]\n roadway_deletion: Optional[RoadwayDeletion]\n roadway_addition: Optional[RoadwayAddition]\n transit_property_change: Optional[TransitPropertyChange]\n transit_routing_change: Optional[TransitRoutingChange]\n transit_service_deletion: Optional[TransitServiceDeletion]\n transit_route_addition: Optional[TransitRouteAddition]\n pycode: Optional[str]\n self_obj_type: Optional[Literal[\"RoadwayNetwork\", \"TransitNetwork\"]]\n
"},{"location":"datamodels/#change-types","title":"Change Types","text":"Change type models for project card.
"},{"location":"datamodels/#projectcard.models.changes.ChangeTypes","title":"ChangeTypes
","text":"Union of all change types.
Source code in projectcard/models/changes.py
class ChangeTypes(BaseModel):\n \"\"\"Union of all change types.\"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n require_one_of: ClassVar = [\n [\n \"roadway_property_change\",\n \"roadway_deletion\",\n \"roadway_addition\",\n \"transit_property_change\",\n \"transit_routing_change\",\n \"transit_service_deletion\",\n \"transit_route_addition\",\n \"pycode\",\n ],\n ]\n\n roadway_property_change: Optional[RoadwayPropertyChanges]\n roadway_deletion: Optional[RoadwayDeletion]\n roadway_addition: Optional[RoadwayAddition]\n transit_property_change: Optional[TransitPropertyChange]\n transit_routing_change: Optional[TransitRoutingChange]\n transit_service_deletion: Optional[TransitServiceDeletion]\n transit_route_addition: Optional[TransitRouteAddition]\n pycode: Optional[str]\n
"},{"location":"datamodels/#projectcard.models.changes.RoadwayAddition","title":"RoadwayAddition
","text":"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:\n links:\n - A: 269066\n B: 268932\n name: new neighborhood st\n roadway: residential\n lanes: 1\n model_link_id: 404982\n - A: 268932\n B: 269066\n name: new neighborhood st\n roadway: residential\n lanes: 1\n model_link_id: 407042\n nodes:\n - model_node_id: 268932\n latitude: 37.7749\n longitude: -122.4194\n - model_node_id: 269066\n latitude: 37.7749\n longitude: -122.4194\n
Source code in projectcard/models/changes.py
class RoadwayAddition(BaseModel):\n \"\"\"Requirements for describing roadway addition project card.\n\n Attributes:\n links (Optional[list[RoadLink]]): Roadway links to add. Must have at least one link.\n nodes (Optional[list[RoadNode]]): Roadway nodes to add. Must have at least one node.\n\n !!! Example \"Example Roadway Addition\"\n ```yaml\n roadway_addition:\n links:\n - A: 269066\n B: 268932\n name: new neighborhood st\n roadway: residential\n lanes: 1\n model_link_id: 404982\n - A: 268932\n B: 269066\n name: new neighborhood st\n roadway: residential\n lanes: 1\n model_link_id: 407042\n nodes:\n - model_node_id: 268932\n latitude: 37.7749\n longitude: -122.4194\n - model_node_id: 269066\n latitude: 37.7749\n longitude: -122.4194\n ```\n \"\"\"\n\n require_any_of: ClassVar = [[\"links\", \"nodes\"]]\n model_config = ConfigDict(extra=\"forbid\")\n\n links: Annotated[Optional[list[RoadLink]], Field(min_length=1)]\n nodes: Annotated[Optional[list[RoadNode]], Field(min_length=1)]\n
"},{"location":"datamodels/#projectcard.models.changes.RoadwayDeletion","title":"RoadwayDeletion
","text":"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
roadway_deletion:\n links:\n model_link_id:\n - 281\n - 477533\n nodes:\n model_node_id:\n - 314159\n clean_shapes: true\n clean_nodes: false\n
Source code in projectcard/models/changes.py
class RoadwayDeletion(BaseModel):\n \"\"\"Requirements for describing roadway deletion project card (e.g. to delete).\n\n Attributes:\n links (Optional[SelectRoadLinks]): Roadway links to delete.\n nodes (Optional[SelectRoadNodes]): Roadway nodes to delete.\n clean_shapes (bool): If True, will clean unused roadway shapes associated with the deleted links\n if they are not otherwise being used. Defaults to False.\n clean_nodes (bool): If True, will clean unused roadway nodes associated with the deleted links\n if they are not otherwise being used. Defaults to False.\n\n !!! Example \"Example Roadway Deletion\"\n ```yaml\n roadway_deletion:\n links:\n model_link_id:\n - 281\n - 477533\n nodes:\n model_node_id:\n - 314159\n clean_shapes: true\n clean_nodes: false\n ```\n \"\"\"\n\n require_any_of: ClassVar = [[\"links\", \"nodes\"]]\n model_config = ConfigDict(extra=\"forbid\")\n\n links: Optional[SelectRoadLinks] = None\n nodes: Optional[SelectRoadNodes] = None\n clean_shapes: bool = False\n clean_nodes: bool = False\n
"},{"location":"datamodels/#projectcard.models.changes.RoadwayPropertyChanges","title":"RoadwayPropertyChanges
","text":"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
roadway_property_change:\n facility:\n links:\n modes: ['drive','bike']\n osm_link_id:\n - '1234'\n - '2345'\n from:\n osm_node_id: '4321'\n to:\n osm_node_id: '4322'\n property_changes:\n lanes:\n existing: 3\n change: -1\n existing_value_conflict: error\n bicycle_facility:\n existing: 1\n set: 3\n existing_value_conflict: skip\n
Source code in projectcard/models/changes.py
class RoadwayPropertyChanges(BaseModel):\n \"\"\"Value for setting property changes for a time of day and category.\n\n Attributes:\n facility (SelectFacility): Selection of roadway links to change properties for.\n property_changes (dict[str, RoadwayPropertyChange]): Property changes to apply to the selection. Must have at least one property change.\n\n !!! Example \"Example Roadway Property Change\"\n ```yaml\n roadway_property_change:\n facility:\n links:\n modes: ['drive','bike']\n osm_link_id:\n - '1234'\n - '2345'\n from:\n osm_node_id: '4321'\n to:\n osm_node_id: '4322'\n property_changes:\n lanes:\n existing: 3\n change: -1\n existing_value_conflict: error\n bicycle_facility:\n existing: 1\n set: 3\n existing_value_conflict: skip\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n facility: SelectFacility\n property_changes: Annotated[dict[str, RoadwayPropertyChange], Field(min_length=1)]\n
"},{"location":"datamodels/#projectcard.models.changes.TransitPropertyChange","title":"TransitPropertyChange
","text":"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
transit_property_change:\n service:\n trip_properties:\n trip_id:\n - 14940701-JUN19-MVS-BUS-Weekday-01\n timespans:\n - ['06:00:00', '09:00:00']\n property_changes:\n headway_secs:\n set: 900\n
Source code in projectcard/models/changes.py
class TransitPropertyChange(BaseModel):\n \"\"\"Value for setting property change for a time of day and category.\n\n Attributes:\n service (SelectTransitTrips): Selection of transit trips to change properties for.\n property_changes (dict[str, TransitPropertyChange]): List of property changes to apply.\n\n !!! Example \"Example Transit Property Change\"\n ```yaml\n transit_property_change:\n service:\n trip_properties:\n trip_id:\n - 14940701-JUN19-MVS-BUS-Weekday-01\n timespans:\n - ['06:00:00', '09:00:00']\n property_changes:\n headway_secs:\n set: 900\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n service: SelectTransitTrips\n property_changes: Annotated[\n dict[str, TransitPropertyChange_PropertyChanges], Field(min_length=1)\n ]\n
"},{"location":"datamodels/#projectcard.models.changes.TransitRouteAddition","title":"TransitRouteAddition
","text":"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:\n routes:\n - route_id: abc\n route_long_name: green_line\n route_short_name: green\n route_type: 3\n agency_id: The Bus\n trips:\n - direction_id: 0\n headway_secs:\n - ('6:00','12:00'): 600\n - ('12:00','13:00'): 900\n routing:\n - 1:\n stop: true #when stop is set to True, defaults to allow both boarding and alighting\n - 2\n - 3\n - 4:\n stop: true # default to False, specify only when stopping\n alight: false # default to True, specify only when not default\n - 5\n - 6:\n stop: true\n
Source code in projectcard/models/changes.py
class TransitRouteAddition(BaseModel):\n \"\"\"Requirements for describing transit route addition project card.\n\n Attributes:\n routes (list[TransitRoute]): List of transit routes to be added. Must have at least one route.\n\n !!! Example \"Example Transit Route Addition\"\n ```yaml\n transit_route_addition:\n routes:\n - route_id: abc\n route_long_name: green_line\n route_short_name: green\n route_type: 3\n agency_id: The Bus\n trips:\n - direction_id: 0\n headway_secs:\n - ('6:00','12:00'): 600\n - ('12:00','13:00'): 900\n routing:\n - 1:\n stop: true #when stop is set to True, defaults to allow both boarding and alighting\n - 2\n - 3\n - 4:\n stop: true # default to False, specify only when stopping\n alight: false # default to True, specify only when not default\n - 5\n - 6:\n stop: true\n\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n routes: Annotated[list[TransitRoute], Field(min_length=1)]\n
"},{"location":"datamodels/#projectcard.models.changes.TransitRoutingChange","title":"TransitRoutingChange
","text":"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\u2019t stop noted as negative integers.
Example Transit Routing Change
transit_routing_change:\n service:\n trip_properties:\n route_id:\n - 294-111\n direction_id: 1\n routing:\n existing:\n - 1\n - 2\n set:\n - 1\n - -11\n - -12\n - 2\n
Source code in projectcard/models/changes.py
class TransitRoutingChange(BaseModel):\n \"\"\"Value for setting routing change for transit.\n\n Attributes:\n service (SelectTransitTrips): Selection of transit trips to change routing for.\n transit_routing_change (TransitRoutingChange): Existing and changed routing as denoted as a list of nodes with\n nodes where the route doesn't stop noted as negative integers.\n\n !!! Example \"Example Transit Routing Change\"\n ```yaml\n transit_routing_change:\n service:\n trip_properties:\n route_id:\n - 294-111\n direction_id: 1\n routing:\n existing:\n - 1\n - 2\n set:\n - 1\n - -11\n - -12\n - 2\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n service: SelectTransitTrips\n routing: TransitRoutingChange_Routing\n
"},{"location":"datamodels/#projectcard.models.changes.TransitServiceDeletion","title":"TransitServiceDeletion
","text":"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
transit_service_deletion:\n service:\n trip_properties:\n route_short_name: \"green\"\n timespans:\n - ['06:00:00', '09:00:00']\n clean_shapes: false\n clean_routes: true\n
Source code in projectcard/models/changes.py
class TransitServiceDeletion(BaseModel):\n \"\"\"Requirements for describing transit service deletion project card (e.g. to delete).\n\n Attributes:\n service (SelectTransitTrips): Selection of transit trips to delete.\n clean_shapes (Optional[bool]): If True, will clean unused transit shapes associated with the deleted trips\n if they are not otherwise being used. Defaults to False.\n clean_routes (Optional[bool]): If True, will clean unused routes associated with the deleted trips if they\n are not otherwise being used. Defaults to False.\n\n !!! Example \"Example Transit Service Deletion\"\n ```yaml\n transit_service_deletion:\n service:\n trip_properties:\n route_short_name: \"green\"\n timespans:\n - ['06:00:00', '09:00:00']\n clean_shapes: false\n clean_routes: true\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n\n service: SelectTransitTrips\n clean_shapes: Optional[bool] = False\n clean_routes: Optional[bool] = False\n
"},{"location":"datamodels/#selections","title":"Selections","text":"Data models for selecting nodes, links, and trips in a project card.
"},{"location":"datamodels/#projectcard.models.selections.SelectFacility","title":"SelectFacility
","text":"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
.
facility:\n links:\n name: [\"main\"]\n from:\n osm_node_id: \"1\"\n to:\n osm_node_id: \"2\"\n
Example: Select links between model nodes 4 and 5 along I-95 that are 3 lanes.
facility:\n links:\n ref: [\"I-95\"]\n lanes: [3]\n from:\n model_node_id: 4\n to:\n model_node_id: 5\n
Example: Select all links on SR320 which have 1 or 2 managed lanes.
facility:\n links:\n ref: [\"SR320\"]\n ML_lanes: [1, 2]\n
Source code in projectcard/models/selections.py
class SelectFacility(BaseModel):\n \"\"\"Roadway Facility Selection.\n\n Each selection must have at either: `links`, `nodes`, or `links` and `from` and `to`.\n\n Specifying `links`, `from`, and `to` will attempt to select a continuous path between the\n two nodes which as much as possible follows the initial link selection that is provided\n (e.g. `name`, `osm_link_id`, `model_link_id`, `ref`) using the specified `modes`.\n Secondary selection parameters (e.g. `lanes`, `price`) will be used to filter the\n continuous path - reulting in a final selection of links that may or may not connect\n the two nodes.\n\n Attributes:\n links (Optional[SelectRoadLinks]): Selection of roadway links.\n nodes (Optional[SelectRoadNodes]): Selection of roadway nodes.\n from (Optional[SelectRoadNode]): Selection of the origin node.\n to (Optional[SelectRoadNode]): Selection of the destination node.\n\n !!! Example \"Example: Select all links between osm nodes 1 and 2 along `main`.\"\n ```yaml\n facility:\n links:\n name: [\"main\"]\n from:\n osm_node_id: \"1\"\n to:\n osm_node_id: \"2\"\n ```\n\n !!! Example \"Example: Select links between model nodes 4 and 5 along I-95 that are 3 lanes.\"\n ```yaml\n facility:\n links:\n ref: [\"I-95\"]\n lanes: [3]\n from:\n model_node_id: 4\n to:\n model_node_id: 5\n ```\n\n !!! Example \"Example: Select all links on SR320 which have 1 or 2 managed lanes.\"\n ```yaml\n facility:\n links:\n ref: [\"SR320\"]\n ML_lanes: [1, 2]\n ```\n \"\"\"\n\n require_one_of: ClassVar = [\n [\"links\", \"nodes\", [\"links\", \"from\", \"to\"]],\n ]\n model_config = ConfigDict(extra=\"forbid\")\n\n links: Optional[SelectRoadLinks] = None\n nodes: Optional[SelectRoadNodes] = None\n from_: Annotated[Optional[SelectRoadNode], Field(None, alias=\"from\")]\n to: Optional[SelectRoadNode] = None\n
"},{"location":"datamodels/#projectcard.models.selections.SelectRoadLinks","title":"SelectRoadLinks
","text":"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 ref
which usually refers to a route or exit number. See: https://wiki.openstreetmap.org/wiki/Key:ref. If multiple provided will be treated as an OR condition.
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 \u2018Main St\u2019 or \u2018Broadway\u2019.
links:\n name: [\"Main St\", \"Broadway\"]\n modes: [\"drive\"]\n lanes: [2, 3]\n
Example: Links with model_link_id 12345 or 67890.
links:\n model_link_id: [12345, 67890]\n
Example: Links where biking is allowed but driving is not.
links:\n all: True\n bike_allowed: true\n drive_allowed: false\n
Source code in projectcard/models/selections.py
class SelectRoadLinks(BaseModel):\n \"\"\"Requirements for describing links in the `facility` section of a project card.\n\n Must have one of `all`, `name`, `osm_link_id`, or `model_link_id`.\n Additional fields to select on may be provided and will be treated as an AND condition after\n the primary selection from `all`, `name`, `osm_link_id`, or `model_link_id`.\n\n Attributes:\n all (bool): If True, select all links.\n name (Optional[list[str]]): List of names to select. If multiple provided will\n be treated as an OR condition.\n ref (Optional[list[str]]): Open Street Map `ref` which usually refers to a route\n or exit number. See: <https://wiki.openstreetmap.org/wiki/Key:ref>. If multiple\n provided will be treated as an OR condition.\n osm_link_id (Optional[list[str]]): List of OSM link IDs to select. If multiple provided\n will be treated as an OR condition.\n model_link_id (Optional[list[int]]): List of model link IDs to select. If multiple provided\n will be treated as an OR condition.\n modes (Optional[Modes]): List of modes to select. If multiple provided will be\n treated as an OR condition.\n ignore_missing (bool): If True, ignore missing links. Otherwise, raise an error\n if they are not found. Defaults to True.\n\n !!! Example \"Example: 2 and 3 lane drivable links named 'Main St' or 'Broadway'.\"\n ```yaml\n links:\n name: [\"Main St\", \"Broadway\"]\n modes: [\"drive\"]\n lanes: [2, 3]\n ```\n\n !!! Example \"Example: Links with model_link_id 12345 or 67890.\"\n ```yaml\n links:\n model_link_id: [12345, 67890]\n ```\n\n !!! Example \"Example: Links where biking is allowed but driving is not.\"\n ```yaml\n links:\n all: True\n bike_allowed: true\n drive_allowed: false\n ```\n \"\"\"\n\n require_conflicts: ClassVar = [\n [\"all\", \"osm_link_id\"],\n [\"all\", \"model_link_id\"],\n [\"all\", \"name\"],\n [\"all\", \"ref\"],\n [\"osm_link_id\", \"model_link_id\"],\n [\"osm_link_id\", \"name\"],\n [\"model_link_id\", \"name\"],\n ]\n require_any_of: ClassVar = [[\"name\", \"ref\", \"osm_link_id\", \"model_link_id\", \"all\"]]\n\n model_config = ConfigDict(extra=\"allow\", coerce_numbers_to_str=True)\n\n all: Optional[bool] = False\n name: Annotated[Optional[list[str]], Field(None, min_length=1)]\n ref: Annotated[Optional[list[str]], Field(None, min_length=1)]\n osm_link_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n model_link_id: Annotated[Optional[list[int]], Field(None, min_length=1)]\n modes: Annotated[Optional[list[Mode]], Field(None, min_length=1)]\n ignore_missing: Optional[bool] = True\n\n _examples: ClassVar[list[dict]] = [\n {\"name\": [\"Main St\"], \"modes\": [\"drive\"]},\n {\"osm_link_id\": [\"123456789\"]},\n {\"model_link_id\": [123456789], \"modes\": [\"walk\"]},\n {\"all\": \"True\", \"modes\": [\"transit\"]},\n ]\n
"},{"location":"datamodels/#projectcard.models.selections.SelectRoadNodes","title":"SelectRoadNodes
","text":"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 all
, osm_node_id
or model_node_id
.
osm_node_id
Optional[list[str]]
List of OSM node IDs to select. Must have either all
, osm_node_id
or model_node_id
.
model_node_id
Optional[list[int]]
List of model node IDs to select. Must have either all
, osm_node_id
or model_node_id
.
ignore_missing
bool
If True, ignore missing nodes. Otherwise, raise an error if they are not found. Defaults to True.
Example Roadway Nodes
nodes:\n model_node_id: [12345, 67890]\n
Source code in projectcard/models/selections.py
class SelectRoadNodes(BaseModel):\n \"\"\"Requirements for describing multiple nodes of a project card (e.g. to delete).\n\n Attributes:\n all (bool): If True, select all nodes. Must have either `all`, `osm_node_id` or\n `model_node_id`.\n osm_node_id (Optional[list[str]]): List of OSM node IDs to select. Must have either\n `all`, `osm_node_id` or `model_node_id`.\n model_node_id (Optional[list[int]]): List of model node IDs to select. Must have either\n `all`, `osm_node_id` or `model_node_id`.\n ignore_missing (bool): If True, ignore missing nodes. Otherwise, raise an error\n if they are not found. Defaults to True.\n\n !!! Example \"Example Roadway Nodes\"\n ```yaml\n nodes:\n model_node_id: [12345, 67890]\n ```\n \"\"\"\n\n require_any_of: ClassVar = [[\"osm_node_id\", \"model_node_id\"]]\n model_config = ConfigDict(extra=\"forbid\", coerce_numbers_to_str=True)\n\n all: Optional[bool] = False\n osm_node_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n model_node_id: Annotated[Optional[list[int]], Field(min_length=1)]\n ignore_missing: Optional[bool] = True\n
"},{"location":"datamodels/#projectcard.models.selections.SelectTransitTrips","title":"SelectTransitTrips
","text":"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.
service:\n route_properties:\n route_id: [\"1\", \"2\"]\n timespans:\n - [\"12:00\", \"19:45\"]\n
Example: Select express route trips that goes through nodes 1, 2, and 3.
service:\n route_properties:\n route_short_name: [\"EXP*\"]\n nodes:\n stop_id: [1, 2, 3]\n require: \"all\"\n
Source code in projectcard/models/selections.py
class SelectTransitTrips(BaseModel):\n \"\"\"Selection of transit trips.\n\n Each selection must have at least one of `trip_properties`, `route_properties`, `nodes`,\n or `links`.\n\n Multiple requirements are treated as an AND condition.\n\n Attributes:\n trip_properties (Optional[SelectTripProperties]): Selection based on trip properties.\n route_properties (Optional[SelectRouteProperties]): Selection based on route properties.\n timespans (List[Timespan]): List of timespans to select. Multiple timespans are treated\n as an OR condition.\n nodes (Optional[SelectTransitNodes]): Transit nodes to select. Useful for querying\n stops that might be moved/deleted when a roadway is changed.\n links (Optional[SelectTransitLinks]): Selection of transit links. Useful for querying\n links that might be moved/deleted when a roadway is changed.\n\n !!! Example \"Example: Select trips on route 1 or 2 that run between 12:00 and 19:45.\"\n ```yaml\n service:\n route_properties:\n route_id: [\"1\", \"2\"]\n timespans:\n - [\"12:00\", \"19:45\"]\n ```\n\n !!! Example \"Example: Select express route trips that goes through nodes 1, 2, and 3.\"\n ```yaml\n service:\n route_properties:\n route_short_name: [\"EXP*\"]\n nodes:\n stop_id: [1, 2, 3]\n require: \"all\"\n ```\n \"\"\"\n\n trip_properties: Annotated[Optional[SelectTripProperties], Field(None)]\n route_properties: Annotated[Optional[SelectRouteProperties], Field(None)]\n timespans: Annotated[Optional[list[Timespan]], Field(None, min_length=1)]\n nodes: Annotated[Optional[SelectTransitNodes], Field(None)]\n links: Annotated[Optional[SelectTransitLinks], Field(None)]\n\n model_config = ConfigDict(\n extra=\"forbid\",\n protected_namespaces=(),\n )\n
"},{"location":"datamodels/#supporting-models","title":"Supporting Models","text":"Structures (lists and objects) used in project card models.
"},{"location":"datamodels/#projectcard.models.structs.Dependencies","title":"Dependencies
","text":"Dependencies for a project card.
Source code in projectcard/models/structs.py
class Dependencies(BaseModel):\n \"\"\"Dependencies for a project card.\"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n conflicts: Optional[list[str]]\n prerequisites: Optional[list[str]]\n corequisites: Optional[list[str]]\n _examples: ClassVar[list[dict]] = [\n {\"conflicts\": [\"a\", \"b\"], \"prerequisites\": [\"c\", \"d\"], \"corequisites\": [\"e\", \"f\"]},\n ]\n
"},{"location":"datamodels/#projectcard.models.structs.IndivScopedPropertySetItem","title":"IndivScopedPropertySetItem
","text":"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
scoped:\n- category: hov3\n timespan: ['6:00', '9:00']\n set: 2.0\n- category: hov2\n change: 1\n
Source code in projectcard/models/structs.py
class IndivScopedPropertySetItem(BaseModel):\n \"\"\"Value for setting property value for a single time of day and category.\n\n Must have at least one of `set` or `change`.\n\n Attributes:\n category: Optional[Union[str, int]]: Category for the property change. If not provided,\n the change will be applied to all categories minus any other categories that are\n provided.\n timespan: Optional[Timespan]: Timespan for the property change. If not provided, the\n change will be applied to the entire timespan minus any other timespans that are\n provided.\n set: Optional[Any]: Value to set for the property change.\n existing: Optional[Any]: Existing value for the property change.\n change: Optional[Union[int, float]]: Change value for the property change.\n\n !!! Example \"Example Scoped Property Set\"\n ```yaml\n scoped:\n - category: hov3\n timespan: ['6:00', '9:00']\n set: 2.0\n - category: hov2\n change: 1\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\", exclude_none=True)\n\n category: Optional[Union[str, int]]\n timespan: Optional[Timespan]\n set: Optional[Any] = None\n existing: Optional[Any] = None\n change: Optional[Union[int, float]] = None\n
"},{"location":"datamodels/#projectcard.models.structs.RoadLink","title":"RoadLink
","text":"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\n A: 269066\n B: 268932\n name: new freeway\n roadway: motorway\n lanes: 3\n distance: 0.5\n sc_lanes:\n - timespan: ['6:00', '9:00']\n value: 2\n - timespan: ['9:00', '15:00']\n value: 4\n sc_price:\n - timespan: ['6:00', '9:00']\n value: 2.0\n - timespan: ['9:00', '15:00']\n value: 4.0\n ML_access_point: 'all'\n ML_egress_point: 'all'\n ML_lanes: 1\n sc_ML_lanes:\n - timespan: ['6:00', '9:00']\n value: 2\n - timespan: ['9:00', '15:00']\n value: 4\n sc_ML_price:\n - timespan: ['6:00', '9:00']\n value: 2.0\n - timespan: ['9:00', '15:00']\n value: 4.0\n
Source code in projectcard/models/structs.py
class RoadLink(BaseModel):\n \"\"\"Requirements for describing new roadway links of a project card.\n\n The following fields may NOT be specified in a ProjectCard as they are calculated or managed\n by Wrangler: `model_link_id_idx`, `managed`, `geometry`, `projects`, `ML_geometry`, `ML_A`,\n `ML_B`, `ML_projects`.\n\n Attributes:\n model_link_id: int: Model link ID.\n A: int: `model_node_id` for the A (from) node.\n B: int: `model_node_id` for the B (to) node.\n name: str: Name of the link.\n roadway: OsmRoadwayType: Roadway facility type based on Open Street Map (OSM) roadway types.\n See: <https://wiki.openstreetmap.org/wiki/Key:highway>.\n lanes: int: Number of lanes. Must be greater than or equal to 0.\n price: Optional[float]: Price for the link.\n rail_only: Optional[bool]: True if the link is rail only.\n bus_only: Optional[bool]: True if the link is bus only.\n drive_access: Optional[bool]: True if the link is drive accessible.\n bike_access: Optional[bool]: True if the link is bike accessible.\n walk_access: Optional[bool]: True if the link is walk accessible.\n truck_access: Optional[bool]: True if the link is truck accessible.\n distance: float: Distance of the link in miles. Must be greater than or equal to 0.\n shape_id: Optional[str]: Shape ID for the link used as a foreign key to a\n roadway shape table.\n osm_link_id: Optional[str]: OSM link ID.\n access: Optional[Any]: Access for the link.\n sc_lanes: Optional[list[dict]]: List of values of the lane property as it changes with\n timespans and/or categories (e.g. HOV, truck, etc.).\n sc_price: Optional[list[dict]]: List of values of the price property as it changes with\n timespans and/or categories (e.g. HOV, truck, etc.).\n ML_access_point: Optional[MLAccessEgress]: Access point for parallel managed lanes.\n ML_egress_point: Optional[MLAccessEgress]: Egress point for parallel managed lanes.\n ML_lanes: Optional[int]: Number of lanes for parallel managed lanes. Must be greater than\n or equal to 0.\n ML_price: Optional[float]: Price for parallel managed lanes.\n ML_access: Optional[Any]: Access for parallel managed lanes.\n sc_ML_lanes: Optional[list[dict]]: List of values of the lane property for parallel managed\n lanes as it changes with timespans and/or categories (e.g. HOV, truck, etc.).\n sc_ML_price: Optional[list[dict]]: List of values of the price property for parallel managed\n lanes as it changes with timespans and/or categories (e.g. HOV, truck, etc.).\n\n !!! Example \"Example Roadway Link\"\n ```yaml\n - model_link_id: 404982\n A: 269066\n B: 268932\n name: new freeway\n roadway: motorway\n lanes: 3\n distance: 0.5\n sc_lanes:\n - timespan: ['6:00', '9:00']\n value: 2\n - timespan: ['9:00', '15:00']\n value: 4\n sc_price:\n - timespan: ['6:00', '9:00']\n value: 2.0\n - timespan: ['9:00', '15:00']\n value: 4.0\n ML_access_point: 'all'\n ML_egress_point: 'all'\n ML_lanes: 1\n sc_ML_lanes:\n - timespan: ['6:00', '9:00']\n value: 2\n - timespan: ['9:00', '15:00']\n value: 4\n sc_ML_price:\n - timespan: ['6:00', '9:00']\n value: 2.0\n - timespan: ['9:00', '15:00']\n value: 4.0\n ```\n \"\"\"\n\n model_config = ConfigDict(coerce_numbers_to_str=True)\n PROTECTED_FIELDS: ClassVar = [\n \"model_link_id_idx\",\n \"managed\",\n \"geometry\",\n \"projects\",\n \"ML_geometry\",\n \"ML_A\",\n \"ML_B\",\n \"ML_projects\",\n ]\n model_link_id: int\n A: int\n B: int\n name: str\n roadway: OsmRoadwayType\n lanes: Annotated[int, Field(ge=0)]\n\n # Fields Wrangler has defaults for that are optional to specify in ProjectCard\n price: Optional[float]\n rail_only: Optional[bool]\n bus_only: Optional[bool]\n drive_access: Optional[bool]\n bike_access: Optional[bool]\n walk_access: Optional[bool]\n truck_access: Optional[bool]\n distance: Annotated[float, Field(ge=0)]\n\n # Optional Fields for Wrangler\n shape_id: Optional[str]\n osm_link_id: Optional[str]\n access: Optional[Any]\n sc_lanes: Optional[list[dict]]\n sc_price: Optional[list[dict]]\n\n # Fields for parallel managed lanes properties\n ML_access_point: Optional[MLAccessEgress]\n ML_egress_point: Optional[MLAccessEgress]\n\n ML_lanes: Optional[Annotated[int, Field(0, ge=0)]]\n ML_price: Optional[Annotated[float, Field(0)]]\n ML_access: Optional[Any]\n\n sc_ML_lanes: Optional[list[dict]]\n sc_ML_price: Optional[list[dict]]\n sc_ML_access: Optional[list[dict]]\n ML_shape_id: Optional[str]\n\n @model_validator(mode=\"before\")\n @classmethod\n def check_protected_omitted(cls, data: Any) -> Any:\n \"\"\"Check that protected fields are omitted.\"\"\"\n if isinstance(data, dict):\n protected_present = [k for k in cls.PROTECTED_FIELDS if k in data]\n if protected_present:\n msg = f\"Protected fields {cls.PROTECTED_FIELDS} must be omitted.\"\n CardLogger.error(msg + f\" Found: {protected_present}\")\n raise ValueError(msg)\n return data\n
"},{"location":"datamodels/#projectcard.models.structs.RoadLink.check_protected_omitted","title":"check_protected_omitted(data)
classmethod
","text":"Check that protected fields are omitted.
Source code in projectcard/models/structs.py
@model_validator(mode=\"before\")\n@classmethod\ndef check_protected_omitted(cls, data: Any) -> Any:\n \"\"\"Check that protected fields are omitted.\"\"\"\n if isinstance(data, dict):\n protected_present = [k for k in cls.PROTECTED_FIELDS if k in data]\n if protected_present:\n msg = f\"Protected fields {cls.PROTECTED_FIELDS} must be omitted.\"\n CardLogger.error(msg + f\" Found: {protected_present}\")\n raise ValueError(msg)\n return data\n
"},{"location":"datamodels/#projectcard.models.structs.RoadNode","title":"RoadNode
","text":"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
class RoadNode(BaseModel):\n \"\"\"Requirements for describing new roadway nodes of a project card.\n\n Attributes:\n model_node_id: int: Model node ID.\n X: Longitude: Longitude of the node.\n Y: Latitude: Latitude of the node.\n \"\"\"\n\n model_node_id: int\n X: Longitude\n Y: Latitude\n
"},{"location":"datamodels/#projectcard.models.structs.RoadwayPropertyChange","title":"RoadwayPropertyChange
","text":"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 scoped
is provided, this value will be used as the default value when no scoped value matches. Should not be provided if set
is provided. This value is assumed to be a scalar difference to be applied to the existing value.
set
Optional[Any]
Optional[Any]: Value to set the property to. If scoped
is provided, this value will be used as the default value when no scoped value matches. Should not be provided if change
is provided.
scoped
Optional[Union[None, ScopedPropertySetList]]
Optional[Union[None, ScopedPropertySetList]]: List of values for the property for various category
(e.g. HOV, truck, etc.) and timespan
(e.g. 6:00-9:00, 9:00-15:00) combinations. When provided, the set
(or applied change
) value will be used as the default value when no scoped value matches.
overwrite_scoped
Optional[Literal['conflicting', 'all', 'error']]
Optional[Literal[\u201cconflicting\u201d, \u201call\u201d, \u201cerror\u201d]]: How to handle conflicting scoped property sets. If conflicting
, conflicting scoped property sets will be overwritten. If all
, all existing scoped property sets will be overwritten. If error
, conflicting scoped property sets will raise an error.
existing_value_conflict
Optional[Literal['error', 'warn', 'skip']]
Optional[Literal[\u201cerror\u201d, \u201cwarn\u201d, \u201cskip\u201d]]: How to handle conflicting existing values. If error
, conflicting existing values will raise an error. If warn
, conflicting existing values will raise a warning. If skip
, property change will be skipped.
Example: Reduce lanes by 1\u2026but only if the existing value is 3.
lanes:\n existing: 3\n change: -1\n existing_value_conflict: skip\n
Example: Set Peak Hour tolls for HOV3 and HOV2.
price:\n overwrite_scoped: all\n change: 0\n scoped:\n - category: hov3\n timespan: ['6:00', '9:00']\n set: 2.0\n - category: hov2\n timespan: ['6:00', '9:00']\n set: 3.0\n
Source code in projectcard/models/structs.py
class RoadwayPropertyChange(BaseModel):\n \"\"\"Value for setting a single property value.\n\n Must have at least one of `set` or `change`.\n\n Attributes:\n existing: Optional[Any]: Existing value for the property change. Assumption about the\n existing (default, not scoped) value for this property.\n change: Optional[Union[int, float]]: Change value for the property change. If `scoped` is\n provided, this value will be used as the default value when no scoped value matches.\n Should not be provided if `set` is provided. This value is assumed to be a scalar\n difference to be applied to the existing value.\n set: Optional[Any]: Value to set the property to. If `scoped` is provided, this value\n will be used as the default value when no scoped value matches. Should not be provided\n if `change` is provided.\n scoped: Optional[Union[None, ScopedPropertySetList]]: List of values for the property for\n various `category` (e.g. HOV, truck, etc.) and `timespan` (e.g. 6:00-9:00, 9:00-15:00)\n combinations. When provided, the `set` (or applied `change`) value will be used as\n the default value when no scoped value matches.\n overwrite_scoped: Optional[Literal[\"conflicting\", \"all\", \"error\"]]: How to handle\n conflicting scoped property sets. If `conflicting`, conflicting scoped property sets\n will be overwritten. If `all`, all existing scoped property sets will be\n overwritten. If `error`, conflicting scoped property sets will raise an error.\n existing_value_conflict: Optional[Literal[\"error\", \"warn\", \"skip\"]]: How to handle\n conflicting existing values. If `error`, conflicting existing values will raise an\n error. If `warn`, conflicting existing values will raise a warning. If `skip`,\n property change will be skipped.\n\n !!! Example \"Example: Reduce lanes by 1...but only if the existing value is 3.\"\n ```yaml\n lanes:\n existing: 3\n change: -1\n existing_value_conflict: skip\n ```\n\n !!! Example \"Example: Set Peak Hour tolls for HOV3 and HOV2.\"\n ```yaml\n price:\n overwrite_scoped: all\n change: 0\n scoped:\n - category: hov3\n timespan: ['6:00', '9:00']\n set: 2.0\n - category: hov2\n timespan: ['6:00', '9:00']\n set: 3.0\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\", exclude_none=True)\n\n existing: Optional[Any] = None\n change: Optional[Union[int, float]] = None\n set: Optional[Any] = None\n scoped: Optional[Union[None, ScopedPropertySetList]] = None\n overwrite_scoped: Optional[Literal[\"conflicting\", \"all\", \"error\"]] = None\n existing_value_conflict: Optional[Literal[\"error\", \"warn\", \"skip\"]] = None\n\n require_one_of: ClassVar = [\n [\"change\", \"set\"],\n ]\n
"},{"location":"datamodels/#projectcard.models.structs.SelectRoadNode","title":"SelectRoadNode
","text":"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
.
osm_node_id
Optional[str]
Optional[str]: OSM node ID to select. Must have either this or model_node_id
.
Example: Select roadway node with model node ID 12345.
model_node_id: 12345\n
Source code in projectcard/models/structs.py
class SelectRoadNode(BaseModel):\n \"\"\"Selection of a single roadway node in the `facility` section of a project card.\n\n Additional properties may be used if they are defined in the roadway network node table.\n\n Attributes:\n model_node_id: Optional[int]: Model node ID to select. Must have either this or\n `osm_node_id`.\n osm_node_id: Optional[str]: OSM node ID to select. Must have either this or\n `model_node_id`.\n\n !!! Example \"Example: Select roadway node with model node ID 12345.\"\n ```yaml\n model_node_id: 12345\n ```\n \"\"\"\n\n require_one_of: ClassVar = [[\"osm_node_id\", \"model_node_id\"]]\n model_config = ConfigDict(extra=\"allow\", coerce_numbers_to_str=True)\n\n osm_node_id: Optional[str]\n model_node_id: Optional[int]\n
"},{"location":"datamodels/#projectcard.models.structs.SelectRouteProperties","title":"SelectRouteProperties
","text":"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 \u2018*\u2019 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 \u2018*\u2019 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 \u2018*\u2019 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 \u2018*\u2019 wildcard character.
Source code in projectcard/models/structs.py
class SelectRouteProperties(BaseModel):\n \"\"\"Selection proeprties for transit routes.\n\n Assumed to be an AND condition if more than one property is provided.\n\n Additional properties may be used if they are defined in the transit route table.\n\n Attributes:\n route_short_name: Optional[List[str]: List of Route short names to select. If more than one\n is provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n route_long_name: Optional[List[str]: List of Route long names to select. If more than one\n is provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n agency_id: Optional[List[str]: List of Agency IDs to select. If more than one is provided,\n the selection will be based on an OR condition. Can also select based on a partial match\n using the '*' wildcard character.\n route_type: Optional[List[int]: List of Route types to select. If more than one is provided,\n the selection will be based on an OR condition. Can also select based on a partial match\n using the '*' wildcard character.\n \"\"\"\n\n model_config = ConfigDict(extra=\"allow\", coerce_numbers_to_str=True)\n route_short_name: Annotated[Optional[list[str]], Field(None, min_length=1)]\n route_long_name: Annotated[Optional[list[str]], Field(None, min_length=1)]\n agency_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n route_type: Annotated[Optional[list[int]], Field(None, min_length=1)]\n\n class ConfigDict:\n \"\"\"Config for the model.\"\"\"\n\n protected_namespaces = ()\n
"},{"location":"datamodels/#projectcard.models.structs.SelectRouteProperties.ConfigDict","title":"ConfigDict
","text":"Config for the model.
Source code in projectcard/models/structs.py
class ConfigDict:\n \"\"\"Config for the model.\"\"\"\n\n protected_namespaces = ()\n
"},{"location":"datamodels/#projectcard.models.structs.SelectTransitLinks","title":"SelectTransitLinks
","text":"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 require
attribute. Must be provided if ab_nodes
is not.
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
attribute. Must be provided if model_link_id
is not.
require
Optional[Literal['any', 'all']]
Optional[Literal[\u201cany\u201d, \u201call\u201d]]: 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.
ab_nodes:\n - A: 1\n B: 2\n - A: 3\n B: 4\nrequire: any\n
Example: Select transit trips with links using model link IDs 123 AND 321.
model_link_id: [123, 321]\nrequire: all\n
Source code in projectcard/models/structs.py
class SelectTransitLinks(BaseModel):\n \"\"\"Requirements for describing multiple transit links of a project card.\n\n Attributes:\n model_link_id: Optional[List[int]]: List of model link IDs to select. If more than one is\n provided, the selection will be OR or AND based on the `require` attribute. Must\n be provided if `ab_nodes` is not.\n ab_nodes: Optional[List[TransitABNodes]]: List of AB nodes to select. If more than one is\n provided, the selection will be OR or AND based on the `require` attribute. Must\n be provided if `model_link_id` is not.\n require: Optional[Literal[\"any\", \"all\"]]: Require either any or all of the selected\n links to meet the selection criteria.\n\n !!! Example \"Example: Select transit trips with links using nodes 1-2 OR 3-4.\"\n ```yaml\n ab_nodes:\n - A: 1\n B: 2\n - A: 3\n B: 4\n require: any\n ```\n\n !!! Example \"Example: Select transit trips with links using model link IDs 123 AND 321.\"\n ```yaml\n model_link_id: [123, 321]\n require: all\n ```\n \"\"\"\n\n require_one_of: ClassVar = [\n [\"ab_nodes\", \"model_link_id\"],\n ]\n\n model_link_id: Annotated[Optional[list[int]], Field(min_length=1)]\n ab_nodes: Annotated[Optional[list[TransitABNodes]], Field(min_length=1)]\n require: Optional[Literal[\"any\", \"all\"]]\n\n model_config = ConfigDict(\n extra=\"forbid\",\n protected_namespaces=(),\n )\n _examples: ClassVar[list[dict]] = [\n {\n \"ab_nodes\": [{\"A\": 75520, \"B\": 66380}, {\"A\": 66380, \"B\": 75520}],\n \"type\": \"any\",\n },\n {\n \"model_link_id\": [123, 321],\n \"type\": \"all\",\n },\n ]\n
"},{"location":"datamodels/#projectcard.models.structs.SelectTransitNodes","title":"SelectTransitNodes
","text":"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
attribute.
require
Optional[Literal['any', 'all']]
Optional[Literal[\u201cany\u201d, \u201call\u201d]]: Require either any or all of the selected nodes to meet the selection criteria.
Example: Select transit trips that use model node IDs 1 AND 2.
stop_id: [1, 2]\nrequire: all\n
Source code in projectcard/models/structs.py
class SelectTransitNodes(BaseModel):\n \"\"\"Selecting trips that use transit nodes.\n\n Attributes:\n stop_id: List[int]: List of model node IDs to select. Must have at least one node.\n Multiple nodes are treated as an OR or AND based on the `require` attribute.\n require: Optional[Literal[\"any\", \"all\"]]: Require either any or all of the selected\n nodes to meet the selection criteria.\n\n !!! Example \"Example: Select transit trips that use model node IDs 1 AND 2.\"\n ```yaml\n stop_id: [1, 2]\n require: all\n ```\n \"\"\"\n\n stop_id: Annotated[list[int], Field(min_length=1)]\n require: Optional[Literal[\"any\", \"all\"]] = \"any\"\n\n model_config = ConfigDict(\n extra=\"forbid\",\n )\n
"},{"location":"datamodels/#projectcard.models.structs.SelectTripProperties","title":"SelectTripProperties
","text":"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 \u2018*\u2019 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 \u2018*\u2019 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 \u2018*\u2019 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 \u2018*\u2019 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 \u2018*\u2019 wildcard character.
Source code in projectcard/models/structs.py
class SelectTripProperties(BaseModel):\n \"\"\"Selection properties for transit trips.\n\n Assumed to be an AND condition if more than one property is provided.\n\n Additional properties may be used if they are defined in the transit trip table.\n\n Attributes:\n trip_id: Optional[List[str]: List of Trip IDs to select. If more than one is provided,\n the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n shape_id: Optional[List[str]: List of Shape IDs to select. If more than one is\n provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n direction_id: Optional[Literal[0, 1]]: Direction ID to select.\n service_id: Optional[List[str]: List Service IDs to select. If more than one is\n provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n route_id: Optional[List[str]: List of Route IDs to select. If more than one is\n provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n trip_short_name: Optional[List[str]: List Trip short names to select. If more than one\n is provided, the selection will be based on an OR condition. Can also select based on\n a partial match using the '*' wildcard character.\n \"\"\"\n\n model_config = ConfigDict(extra=\"allow\", coerce_numbers_to_str=True)\n\n trip_id: Annotated[Optional[list[str]], Field(None, misn_length=1)]\n shape_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n direction_id: Optional[Literal[0, 1]] = None\n service_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n route_id: Annotated[Optional[list[str]], Field(None, min_length=1)]\n trip_short_name: Annotated[Optional[list[str]], Field(None, min_length=1)]\n\n class ConfigDict:\n \"\"\"Config for the model.\"\"\"\n\n protected_namespaces = ()\n
"},{"location":"datamodels/#projectcard.models.structs.SelectTripProperties.ConfigDict","title":"ConfigDict
","text":"Config for the model.
Source code in projectcard/models/structs.py
class ConfigDict:\n \"\"\"Config for the model.\"\"\"\n\n protected_namespaces = ()\n
"},{"location":"datamodels/#projectcard.models.structs.TransitABNodes","title":"TransitABNodes
","text":"Single transit link model.
Source code in projectcard/models/structs.py
class TransitABNodes(BaseModel):\n \"\"\"Single transit link model.\"\"\"\n\n A: Optional[int] = None # model_node_id\n B: Optional[int] = None # model_node_id\n\n model_config = ConfigDict(\n extra=\"forbid\",\n )\n
"},{"location":"datamodels/#projectcard.models.structs.TransitPropertyChange_PropertyChanges","title":"TransitPropertyChange_PropertyChanges
","text":"Value for setting a single property value for transit.
Source code in projectcard/models/structs.py
class TransitPropertyChange_PropertyChanges(BaseModel):\n \"\"\"Value for setting a single property value for transit.\"\"\"\n\n model_config = ConfigDict(extra=\"forbid\", exclude_none=True)\n\n existing: Optional[Any] = None\n change: Optional[Union[int, float]] = None\n set: Optional[Any] = None\n existing_value_conflict: Optional[Literal[\"error\", \"warn\", \"skip\"]] = None\n\n require_one_of: ClassVar = [\n [\"change\", \"set\"],\n ]\n
"},{"location":"datamodels/#projectcard.models.structs.TransitRoute","title":"TransitRoute
","text":"Description of a new transit route.
Attributes:
Name Type Description route_id
str
agency_id
str
https://gtfs.org/reference/static/#routes.txt.
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
https://gtfs.org/reference/static/#routes.txt.
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
class TransitRoute(BaseModel):\n \"\"\"Description of a new transit route.\n\n Attributes:\n route_id: str: Route ID for the route.\n agency_id: str: Agency ID for the route. See GTFS for more information:\n <https://gtfs.org/reference/static/#routes.txt>.\n route_short_name: Optional[str]: Route short name for the route. See GTFS for more\n information: <https://gtfs.org/reference/static/#routes.txt>.\n route_long_name: Optional[str]: Route long name for the route. See GTFS for more\n information: <https://gtfs.org/reference/static/#routes.txt>.\n route_type: int: Route type for the route. See GTFS for more information:\n <https://gtfs.org/reference/static/#routes.txt>.\n trips: list[TransitTrip]: List of trips for the route. Must have at least one trip.\n \"\"\"\n\n model_config = ConfigDict(coerce_numbers_to_str=True)\n route_id: str\n agency_id: str\n route_short_name: Optional[str]\n route_long_name: Optional[str]\n route_type: int\n trips: Annotated[list[TransitTrip], Field(min_length=1)]\n
"},{"location":"datamodels/#projectcard.models.structs.TransitRoutingChange_Routing","title":"TransitRoutingChange_Routing
","text":"Value for setting routing change for transit.
Attributes:
Name Type Description existing
list[int]
list[int]: list of model_node_id
for the extent of the existing nodes to change.
set
list[int]
list[int]: list of model_node_id
for the extent of the new nodes to set. Nodes which are negative will be treated as non-stops.
Example: Reroute around node 2.
routing:\n existing: [1, -2, 3]\n set: [1, -4, -5, -6, 3]\n
Source code in projectcard/models/structs.py
class TransitRoutingChange_Routing(BaseModel):\n \"\"\"Value for setting routing change for transit.\n\n Attributes:\n existing: list[int]: list of `model_node_id` for the extent of the existing nodes\n to change.\n set: list[int]: list of `model_node_id` for the extent of the new nodes to set.\n Nodes which are negative will be treated as non-stops.\n\n !!! Example \"Example: Reroute around node 2.\"\n ```yaml\n routing:\n existing: [1, -2, 3]\n set: [1, -4, -5, -6, 3]\n ```\n \"\"\"\n\n model_config = ConfigDict(extra=\"forbid\")\n existing: list[int]\n set: list[int]\n
"},{"location":"datamodels/#projectcard.models.structs.TransitStopProps","title":"TransitStopProps
","text":"Representation of details about a single transit stop for a new route.
Must have at at least either:
stop
-
board
and alight
-
If stop
is True, then board
and alight
are assumed to be True unless otherwise specified.
- If
stop
is False, then board
and alight
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.
Example: Stop with only boarding.
alight: false\nboard: true\n
Example: Stop with no boarding or alighting.
stop: false\n
Example: Stop with boarding and alighting.
stop: true\ntime_to_next_node_sec: 68\n
Source code in projectcard/models/structs.py
class TransitStopProps(BaseModel):\n \"\"\"Representation of details about a single transit stop for a new route.\n\n Must have at at least either:\n\n - `stop`\n - `board` and `alight`\n\n - If `stop` is True, then `board` and `alight` are assumed to be True unless otherwise\n specified.\n - If `stop` is False, then `board` and `alight` are assumed to be False unless otherwise\n specified.\n\n Attributes:\n stop: Optional[bool]: True if the stop is a stop on the route.\n dwell_secs: Optional[PositiveInt]: Dwell time in seconds at the stop.\n time_to_next_node_sec: Optional[PositiveInt]: Time in seconds to the next node.\n board: Optional[bool]: True if the stop is a boarding stop.\n alight: Optional[bool]: True if the stop is an alighting stop.\n\n !!! Example \"Example: Stop with only boarding.\"\n ```yaml\n alight: false\n board: true\n ```\n\n !!! Example \"Example: Stop with no boarding or alighting.\"\n ```yaml\n stop: false\n ```\n\n !!! Example \"Example: Stop with boarding and alighting.\"\n ```yaml\n stop: true\n time_to_next_node_sec: 68\n ```\n \"\"\"\n\n require_one_of: ClassVar = [\n [\"stop\", \"board\"],\n [\"stop\", \"alight\"],\n [\"stop\"],\n [\"board\", \"alight\"],\n ]\n stop: Optional[bool]\n dwell_secs: Optional[PositiveInt]\n time_to_next_node_sec: Optional[PositiveInt]\n board: Optional[bool]\n alight: Optional[bool]\n
"},{"location":"datamodels/#projectcard.models.structs.TransitTrip","title":"TransitTrip
","text":"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: {\"('7:00', '9:00')\": 600}
.
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
- route_id: 1\n service_id: weekday\n trip_headsign: downtown\n trip_short_name: 1\n direction_id: 0\n headway_secs:\n - ('6:00', '12:00'): 600\n - ('12:00', '13:00'): 900\n routing:\n - 1:\n stop: true\n - 2\n - 3\n - 4:\n stop: true\n alight: false\n - 5\n - 6:\n stop: true\n
Source code in projectcard/models/structs.py
class TransitTrip(BaseModel):\n \"\"\"Description of a new transit trip.\n\n Additional properties may be used so long as they do not conflict with the fields:\n `trip_id`, `shape_id`, and `route_id`. `route_id` is provided at the route-level and\n `trip_id`, `shape_id` are managed by Wrangler in order to ensure primary and foreign\n key constraints are met.\n\n Attributes:\n headway_secs: list[TransitHeadways]: List of headways for the trip - each of which is a\n dictionary of a single timespans and headway value. Must have at least one headway.\n Example: `{\"('7:00', '9:00')\": 600}`.\n routing: TransitRouting: Routing for the trip which is a list of nodes or detailed\n stop properties.\n service_id: Optional[str]: Service ID for the trip. See GTFS for more information:\n <https://gtfs.org/reference/static/#trips.txt>.\n trip_headsign: Optional[str]: Trip headsign. See GTFS for more information:\n <https://gtfs.org/reference/static/#trips.txt>.\n trip_short_name: Optional[str]: Trip short name. See GTFS for more information:\n <https://gtfs.org/reference/static/#trips.txt>.\n direction_id: Optional[int]: Direction ID for the trip. Must be either 0 or 1. See\n GTFS for more information: <https://gtfs.org/reference/static/#trips.txt>.\n\n !!! Example \"Example: New Transit Trip\"\n ```yaml\n - route_id: 1\n service_id: weekday\n trip_headsign: downtown\n trip_short_name: 1\n direction_id: 0\n headway_secs:\n - ('6:00', '12:00'): 600\n - ('12:00', '13:00'): 900\n routing:\n - 1:\n stop: true\n - 2\n - 3\n - 4:\n stop: true\n alight: false\n - 5\n - 6:\n stop: true\n ```\n \"\"\"\n\n model_config = ConfigDict(coerce_numbers_to_str=True)\n PROTECTED_FIELDS: ClassVar = [\"trip_id\", \"shape_id\", \"route_id\"]\n headway_secs: Annotated[list[TransitHeadways], Field(min_length=1)]\n routing: TransitRouting\n service_id: Optional[str]\n trip_headsign: Optional[str]\n trip_short_name: Optional[str]\n direction_id: Optional[int]\n
"},{"location":"datamodels/#supporting-types","title":"Supporting Types","text":"Field types for the projectcard models.
"},{"location":"datamodels/#projectcard.models.fields.MLAccessEgress","title":"MLAccessEgress = Union[Literal['all'], list[int]]
module-attribute
","text":"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.
"},{"location":"datamodels/#projectcard.models.fields.Mode","title":"Mode = Literal['drive', 'walk', 'bike', 'transit', 'any']
module-attribute
","text":"Which modes are searched for. If any
is specified, all modes are searched for.
"},{"location":"datamodels/#projectcard.models.fields.OsmRoadwayType","title":"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
","text":"Open Street Map Roadway Types. See: https://wiki.openstreetmap.org/wiki/Key:highway.
"},{"location":"datamodels/#projectcard.models.fields.TimeString","title":"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
","text":"A HH:MM or HH:MM:SS time string. Example: \"23:44\"
.
"},{"location":"datamodels/#projectcard.models.fields.Timespan","title":"Timespan = Annotated[list[TimeString], Field(examples=[['12:00', '19:45:00']], max_length=2, min_length=2)]
module-attribute
","text":"A list of two time strings representing a start and end time for a time span. Example: [\"12:00\", \"19:45:00\"]
.
"},{"location":"development/","title":"Development","text":""},{"location":"development/#development-environment","title":"Development Environment","text":"If you plan on developing and changing code within the projectcard
project, you will likely want to set up your own development environment from a cloned fork.
Helpful prerequisites:
- github desktop
- conda
- VS Code (or another IDE)
Fork and Install:
-
Fork and clone repo locally
gh cligithub ux gh repo fork network-wrangler/projectcard --clone=true\ncd projectcard\ngit remote add upstream https://github.com/network-wrangler/projectcard.git\n
- In browser, fork the repository to your github account: https://github.com/network-wrangler/projectcard/fork.
- In the browser with your new fork, click green
code
botton and clone to local disk using Github Desktop. - Add the original repo to your upstream remotes to be able to track changes:
- Make sure the cloned repository is open in GitHub Desktop
- Click on
Repository
in the menu bar - Select Open in Terminal (or Open in Git Bash on Windows).
- In the terminal window that opens, enter the following command to add the original repository as a remote named upstream:
git remote add upstream https://github.com/network-wrangler/projectcard.git\n
-
Install dependencies
conda (recommended)pip conda install --yes --file requirements.txt\n
pip install -r requirements.txt\n
-
Install from working directory
pip install -e .\n
"},{"location":"development/#keeping-your-fork-updated","title":"Keeping your fork updated","text":"To make sure any development and work you are doing takes advantage of and is compatable with the main projectcard repository, you will want to fetch and merge updates.
Using Github DesktopIn terminal Click on Fetch origin in the top bar of GitHub Desktop to fetch the latest changes from your fork.
Open the repository in the terminal and run the following command to fetch updates from the upstream repository and merge the udpates into your local branch.
git fetch upstream\ngit merge upstream/main\n
Replace main with the branch of the repository you want to develop towards if it is different.
"},{"location":"development/#style-guide","title":"Style Guide","text":" - All public modules and functions should be documented using google-style docstrings.
- Public modules should be documented with usage examples.
- Public functions should be covered by a test, located in the
/tests
folder. - Code should be formatted per the
ruff
implementation of PEP8 (which is like black
, but faster) - Line width should be no more than 99 characters.
- Document function signatures with type annotations and pass inspection with
mypy
To make sure your code conforms to our style \u2013 ensuring that all differences are meaningful and not just fommatting \u2013 please use pre-commit
before submitting any pull-requests to the main repository:
pre-commit run --all-files\n
This will make sure your code conforms to our guidelines as defined in pyproject.toml
.
"},{"location":"development/#contributing","title":"Contributing","text":"Generally we are happy to accept pull-requests directly to the main
branch which improve documentation or make very minor changes. If you are making more significant changes, please:
"},{"location":"development/#before-starting","title":"Before starting","text":" - Create an issue describing the problem you ar solving: Make sure people know what you are working on and that they can let you know sooner rather than later about their opinions (or assign yourself an existing issue).
"},{"location":"development/#developing","title":"Developing","text":" - Follow the style guide
- Regularly update your fork with upstream changes
"},{"location":"development/#incorporating-code-to-main-projectcard-repository","title":"Incorporating Code to main ProjectCard Repository","text":" - Make sure your code passes all tests
- If you updated documentation, make [sure it properly builds].
- Run
pre-commit
- Submit a pull-request to the main project card repository and thoroughly describe the problem you are trying to solve, referencing the issue it addresses
- Respond to requests from the code reviewer
"},{"location":"development/#documentation","title":"Documentation","text":"Documentation is maintained in the /docs
repository in markdown text files and is built using the mkdocs
package. Public documentation is built using a Github Workflow (.github/workflows/push.yml
) and published using mike
to Github Pages.
"},{"location":"development/#build-the-documentation-locally","title":"Build the documentation locally","text":"This is useful to make sure that changes you made are rendered as you would expect them.
install documentation dependenciespip -r docs/requirements.txt\n
building documentation locallymkdocs serve\n
"},{"location":"development/#releases","title":"Releases","text":" - Releases follow semantic versioning.
- Releases are triggered by project management team via the github \u201creleases\u201d interface.
- Creating a release in github will trigger a github action to send it to
pypi
so that users installing it via pip
will have access to it.
Tip
Releases must have a unique version number in order to be updated on pypi.
"},{"location":"development/#changelog","title":"Changelog","text":"Notable changes and version history.
Version Date Comment v0.3.1 2024-10-07 Improved resilience of read_cards()
including ability to handle relative paths. v0.3.0 2024-09-27 Added transit addition and deletion change types. v0.2.0 2024-09-08 Read cards from nested folders. v0.1.2 2024-08-05 - v0.1.1 2024-06-20 Initial release on PyPI"},{"location":"examples/","title":"Example Data","text":"Example data can be found in the /examples
directory.
Name Category Notes Blue Line Service Enhancement A Transit Property Change changes headway for a single trip during the morning peak Remove Am Service On The Green Line Transit Service Deletion Convert Intersection To Interchange Multiple: Roadway Deletion, Roadway Addition demonstrates how to nest multiple changes into a single project under changes
Example Calculate Mega Freeways Pycode Example Delete Roadway Roadway Deletion simple roadway deletion Example Property Change For All Links Roadway Property Change Reduce lanes and add separated bike facility for all drive links with two lanes and bicycle facility of 0,2, or 3 Example Roadway Add Roadway Addition Simple project card to add new roadway Bus Resign Transit Property Change Change Node X Value Location Roadway Property Change Bus Reroute Transit Routing Change re-routes a bus route to avoid construction Example Add Simple Managed Lane Project Roadway Property Change Simple managed lane project with AM and PM lanes are tolled based on occupancy Example Roadway Addition And Deletion Multiple: Roadway Deletion, Roadway Addition project card with multiple category of add and delete changes Example I394 Parallel Lanes Roadway Property Change demonstrates how to add managed lanes to an existing roadway with restricted access New Green Transit Transit Route Addition Example Property Change Roadway Property Change Simple road diet"},{"location":"examples/#cards","title":"Cards","text":""},{"location":"examples/#blue-line-service-enhancement-a","title":"Blue Line Service Enhancement A","text":"Category: Transit Property Change examples/transit-property-change.yml
project: Blue Line Service Enhancement A\nnotes: changes headway for a single trip during the morning peak\ntags:\n - example\ntransit_property_change:\n service:\n trip_properties:\n trip_id:\n - 14940701-JUN19-MVS-BUS-Weekday-01\n timespans:\n - ['06:00:00', '09:00:00']\n property_changes:\n headway_secs:\n set: 900\n
"},{"location":"examples/#remove-am-service-on-the-green-line","title":"Remove Am Service On The Green Line","text":"Category: Transit Service Deletion examples/transit-service_deletion.yml
project: Remove AM service on the Green Line\ntransit_service_deletion:\n service:\n trip_properties:\n route_short_name: \"green\"\n timespans:\n - ['06:00:00', '09:00:00']\n clean_shapes: false\n clean_routes: true\n
"},{"location":"examples/#convert-intersection-to-interchange","title":"Convert Intersection To Interchange","text":"Category: Multiple: Roadway Deletion, Roadway Addition examples/roadway-add-interchange.yml
project: convert intersection to interchange\nnotes: demonstrates how to nest multiple changes into a single project under `changes`\nchanges:\n- roadway_deletion:\n links:\n model_link_id:\n - 2171\n - 25856\n - 383747\n - 383790\n- roadway_addition:\n links:\n - A: 354386\n name: interchange ramp\n roadway: motorway_link\n B: 16214\n distance : 0.13201\n lanes: 1\n model_link_id: 2171\n bus_only: 0\n rail_only: 0\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 16214\n name: interchange ramp\n roadway: motorway_link\n B: 354386\n distance: 0.13201\n lanes: 1\n model_link_id: 25856\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 4336\n name: interchange ramp\n roadway: motorway_link\n B: 354387\n distance: 0.14848\n lanes: 1\n model_link_id: 2171\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354387\n name: interchange ramp\n roadway: motorway_link\n B: 354386\n distance: 0.10981\n lanes: 1\n model_link_id: 2171\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354386\n name: interchange ramp\n roadway: motorway_link\n B: 354387\n distance: 0.10981\n lanes: 1\n model_link_id: 25856\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354387\n name: interchange ramp\n roadway: motorway_link\n B: 4336\n distance: 0.14848\n lanes: 1\n model_link_id: 25856\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354388\n name: interchange ramp\n roadway: motorway_link\n B: 13931\n distance: 0.55987\n lanes: 2\n model_link_id: 383747\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 12590\n name: interchange ramp\n roadway: motorway_link\n count_AM: 0\n B: 354389\n distance: 0.15228\n lanes: 2\n model_link_id: 383747\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354389\n name: interchange ramp\n roadway: motorway_link\n B: 354388\n distance: 0.16071\n lanes: 2\n model_link_id: 383747\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 12655\n name: interchange ramp\n roadway: motorway_link\n B: 354390\n distance: 0.21899\n lanes: 3\n model_link_id: 383790\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354390\n name: interchange ramp\n roadway: motorway_link\n B: 354391\n distance: 0.21108\n lanes: 3\n model_link_id: 383790\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354391\n B: 14248\n name: interchange ramp\n roadway: motorway_link\n distance: 0.36316\n lanes: 3\n model_link_id: 383790\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354387\n name: interchange ramp\n roadway: motorway_link\n B: 354388\n distance: 0.09188\n lanes: 2\n model_link_id: 384040\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354390\n name: interchange ramp\n roadway: motorway_link\n B: 354386\n distance: 0.12286\n lanes: 2\n model_link_id: 384040\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354386\n name: interchange ramp\n roadway: motorway_link\n B: 354391\n distance: 0.08689\n lanes: 2\n model_link_id: 384040\n bike_access: 0\n drive_access: 1\n walk_access: 0\n - A: 354389\n B: 354387\n name: interchange ramp\n roadway: motorway_link\n distance: 0.09431\n lanes: 2\n model_link_id: 384040\n bike_access: 0\n drive_access: 1\n walk_access: 0\n nodes:\n - X: -93.14412\n Y: 44.87497\n model_node_id: 354386\n - X: -93.14189\n Y: 44.87499\n model_node_id: 354387\n - X: -93.14239\n Y: 44.87644\n model_node_id: 354388\n - X: -93.14322\n Y: 44.87414\n model_node_id: 354389\n - X: -93.14273\n Y: 44.87648\n model_node_id: 354390\n - X: -93.14382\n Y: 44.87355\n model_node_id: 354391\n
"},{"location":"examples/#example-calculate-mega-freeways","title":"Example Calculate Mega Freeways","text":"Category: Pycode examples/roadway-calculated.wr
---\nproject: example calculate mega freeways\nself_obj_type: RoadwayNetwork\n---\n\nself.links_df.loc[self.links_df['lanes'] == 4, 'lanes'] = 12\n
"},{"location":"examples/#example-delete-roadway","title":"Example Delete Roadway","text":"Category: Roadway Deletion examples/roadway-delete.yml
project: example delete roadway\nnotes: simple roadway deletion\ntags:\n - 'delete roadway'\n - 'example'\nroadway_deletion:\n links:\n model_link_id:\n - 281\n - 477533\n nodes:\n model_node_id:\n - 314159\n
"},{"location":"examples/#example-property-change-for-all-links","title":"Example Property Change For All Links","text":"Category: Roadway Property Change examples/roadway-property-change-all.yml
project: Example property change for all links\ntags:\n - 'example'\nroadway_property_change:\n facility:\n links:\n modes: ['drive']\n all: 'True'\n lanes: 2\n bicycle_facility: [0,2,3]\n property_changes:\n lanes:\n set: 1\n bicycle_facility:\n set: 1\nnotes: Reduce lanes and add separated bike facility for all drive links with two lanes and bicycle facility of 0,2, or 3\n
"},{"location":"examples/#example-roadway-add","title":"Example Roadway Add","text":"Category: Roadway Addition examples/roadway-add.yml
project: example roadway add\nnotes: Simple project card to add new roadway\ntags:\n - 'add roadway'\n - 'example'\nroadway_addition:\n links:\n - A: 269066\n B: 268932\n name: new neighborhood st\n bike_access: 1\n drive_access: 0\n bus_only: 0\n rail_only: 0\n walk_access: 1\n roadway: residential\n lanes: 1\n model_link_id: 404982\n - A: 268932\n B: 269066\n bike_access: 1\n name: new neighborhood st\n drive_access: 0\n bus_only: 0\n rail_only: 0\n walk_access: 1\n roadway: residential\n lanes: 1\n model_link_id: 407042\n
"},{"location":"examples/#bus-resign","title":"Bus Resign","text":"Category: Transit Property Change examples/transit-node-selection.yml
project: Bus resign\ntags:\n - existing_plus_committed\ntransit_property_change:\n service:\n trip_properties:\n route_id:\n - \"294-111\"\n nodes:\n model_node_id:\n - 37582\n - 37574\n require: \"any\"\n property_changes:\n trip_headsign:\n change: \" thru Union Station\"\n
"},{"location":"examples/#change-node-x-value-location","title":"Change Node X Value Location","text":"Category: Roadway Property Change examples/roadway-node-property-change.yml
project: Change node X value location\nroadway_property_change:\n facility:\n nodes:\n model_node_id: [1234]\n property_changes:\n X:\n set: 1.0\n
"},{"location":"examples/#bus-reroute","title":"Bus Reroute","text":"Category: Transit Routing Change examples/transit-shape-change.yml
project: Bus Reroute\nnotes: re-routes a bus route to avoid construction\ntags:\n - existing_plus_committed\ntransit_routing_change:\n service:\n trip_properties:\n route_id:\n - 294-111\n direction_id: 1\n routing:\n existing:\n - -37582\n - -37574\n - -4761\n - -4763\n - -4764\n - -98429\n - 45985\n - -57483\n - -126324\n - -57484\n - 150855\n - -11188\n - 84899\n - 46666\n - -77077\n set:\n - -37582\n - -37574\n - -4761\n - -4763\n - -4764\n - -98429\n - 45985\n - -57483\n - -126324\n - -57484\n - 150855\n - -11188\n - 84899\n - 46666\n - -46665\n - -46663\n - -81820\n - -76167\n - -77077\n
"},{"location":"examples/#example-add-simple-managed-lane-project","title":"Example Add Simple Managed Lane Project","text":"Category: Roadway Property Change examples/roadway-add-managed-lane-simple.yml
project: example add simple managed lane project\nnotes: Simple managed lane project with AM and PM lanes are tolled based on occupancy\ntags:\n - 'example'\n - 'managed'\nroadway_property_change:\n facility:\n links:\n name:\n - 'I 35E'\n from:\n osm_node_id: '961117623'\n to:\n osm_node_id: '2564047368'\n property_changes:\n segment_id:\n set: 35EHOT-A\n lanes:\n set: 3\n scoped:\n - timespan: ['6:00', '9:00']\n set: 2\n - timespan: ['16:00', '19:00']\n set: 2\n ML_lanes:\n set: 0\n scoped:\n - timespan: ['6:00', '9:00']\n set: 1\n - timespan: ['16:00', '19:00']\n set: 1\n ML_price:\n set: 0\n overwrite_scoped: \"all\"\n scoped:\n - timespan: ['6:00', '9:00']\n category: ['sov']\n set: 1.5\n - timespan: ['16:00', '19:00']\n category: ['sov']\n set: 2.5\n - timespan: ['6:00', '9:00']\n category: ['hov2']\n set: 1.0\n - timespan: ['16:00', '19:00']\n category: ['hov2']\n set: 2.0\n ML_access_point:\n set: 'all'\n ML_egress_point:\n set: 'all'\n
"},{"location":"examples/#example-roadway-addition-and-deletion","title":"Example Roadway Addition And Deletion","text":"Category: Multiple: Roadway Deletion, Roadway Addition examples/roadway-add-delete.yml
project: example roadway addition and deletion\ntags:\n - 'add and delete roadway'\nchanges:\n - roadway_addition:\n nodes:\n - model_node_id: 314159\n X: -93.18389\n Y: 44.96898\n drive_node: 1\n walk_node: 0\n bike_node: 0\n transit_node: 1\n - roadway_deletion:\n links:\n model_link_id:\n - 281\n - 477533\n nodes:\n model_node_id:\n - 314159\n - roadway_addition:\n links:\n - A: 3230\n B: 3262\n model_link_id: 999998\n trn_priority: 0\n lanes: 1\n name: new bike greenway and neighborhood st\n bike_facility: 3\n drive_access: 1\n walk_access: 1\n bike_access: 1\n bus_only: 0\n rail_only: 0\n roadway: residential\n distance: 0.10462\n ttime_assert: 0.0\n OPERATION_final: A\n - A: 3262\n B: 3230\n model_link_id: 999997\n trn_priority: 0\n lanes: 1\n name: new bike greenway and neighborhood st\n bike_facility: 3\n drive_access: 1\n walk_access: 1\n bike_access: 1\n bus_only: 0\n rail_only: 0\n roadway: residential\n distance: 0.10462\n ttime_assert: 0.0\n OPERATION_final: A\n nodes:\n - model_node_id: 354388\n X: -93.18389\n Y: 44.96898\n drive_node: 1\n walk_node: 0\n bike_node: 0\n transit_node: 1\nnotes: project card with multiple category of add and delete changes\n
"},{"location":"examples/#example-i394-parallel-lanes","title":"Example I394 Parallel Lanes","text":"Category: Roadway Property Change examples/roadway-add-managed-lane-restricted-access.yml
project: Example I394 Parallel Lanes\ntags: ['managed lanes']\nnotes: demonstrates how to add managed lanes to an existing roadway with restricted access\nroadway_property_change:\n facility:\n links:\n model_link_id:\n - 390239\n - 391206\n - 390344\n - 401484\n property_changes:\n ML_lanes:\n set: 0\n scoped:\n - timespan: ['6:00', '9:00']\n set: 1\n overwrite_conflicts: true\n - timespan: ['15:00', '18:00']\n set: 1\n lanes:\n change: 0\n scoped:\n - timespan: ['6:00', '9:00']\n change: -1\n - timespan: ['15:00', '18:00']\n change: -1\n segment_id:\n set: 5\n ML_HOV:\n set: 5\n HOV:\n set: 5\n ML_access_point:\n set: [38765, 87982]\n ML_egress_point:\n set: [87993, 37457]\n
"},{"location":"examples/#new-green-transit","title":"New Green Transit","text":"Category: Transit Route Addition examples/transit-route_addition.yml
project: New Green Transit\ntags:\n - new transit\ntransit_route_addition:\n routes:\n - route_id: abc\n route_long_name: green_line\n route_short_name: green\n route_type: 3\n agency_id: The Bus\n trips:\n - direction_id: 0\n headway_secs:\n - ('6:00','12:00'): 600\n - ('12:00','13:00'): 900\n routing:\n - 1:\n stop: true #when stop is set to True, defaults to allow both boarding and alighting\n - 2\n - 3\n - 4:\n stop: true # default to False, specify only when stopping\n alight: false # default to True, specify only when not default\n - 5\n - 6:\n stop: true\n - direction_id: 1\n headway_secs:\n - ('6:00','12:00'): 600\n - ('12:00','13:00'): 900\n routing:\n - 6:\n stop: true\n - 5:\n stop: true\n dwell_sec: 30\n - 4:\n stop: true\n - 6\n - 3:\n time_to_next_node_sec: 90\n - 2:\n stop: true\n - 1:\n stop: true\n
"},{"location":"examples/#example-property-change","title":"Example Property Change","text":"Category: Roadway Property Change examples/roadway-property-change.yml
project: Example property change\ntags:\n - 'example'\nroadway_property_change:\n facility:\n links:\n modes: ['drive','bike']\n osm_link_id:\n - '1234'\n - '2345'\n from:\n osm_node_id: '4321'\n to:\n osm_node_id: '4322'\n property_changes:\n lanes:\n existing: 3\n change: -1\n existing_value_conflict: error\n bicycle_facility:\n existing: 1\n set: 3\n existing_value_conflict: skip\nnotes: Simple road diet\n
"},{"location":"json-schemas/","title":"Schema Documentation","text":"Find this documentation confusing?
Me too. That\u2019s why we spent a bunch more time documenting the data models, which read much more nicely - or you can check out the examples.
/
"},{"location":"json-schemas/#projectcardjson","title":"projectcard.json","text":"Type: Object
Additional Information:
title: Project Card Schema
Definitions:
Definition Type Description Restrictions change_roadway_deletion
changes/roadway_deletion.json
- change_roadway_addition
changes/roadway_addition.json
- change_roadway_property_change
changes/roadway_property_change.json
- transit_property_change
changes/transit_property_change.json
- transit_routing_change
changes/transit_routing_change.json
- transit_route_addition
changes/transit_route_addition.json
- transit_service_deletion
changes/transit_service_deletion.json
- pycode
string
- change
object
- One Of:- {\u201crequired\u201d: [\u201croadway_deletion\u201d]}
- {\u201crequired\u201d: [\u201croadway_addition\u201d]}
- {\u201crequired\u201d: [\u201croadway_property_change\u201d]}
- {\u201crequired\u201d: [\u201ctransit_property_change\u201d]}
- {\u201crequired\u201d: [\u201ctransit_routing_change\u201d]}
- {\u201crequired\u201d: [\u201ctransit_route_addition\u201d]}
- {\u201crequired\u201d: [\u201ctransit_service_deletion\u201d]}
- {\u201crequired\u201d: [\u201cpycode\u201d]}
Properties:
Property Type Description Restrictions $schema
string
Reference to the project card schema which this file uses. If not specified, will be assumed to be the most recent release. project
string
A project name which uniquely identifies this project dependencies
defs/dependencies.json
- tags
defs/tags.json
- roadway_deletion
#/$defs/change_roadway_deletion
- roadway_addition
#/$defs/change_roadway_addition
- roadway_property_change
#/$defs/change_roadway_property_change
- roadway_managed_lanes
#/$defs/change_roadway_property_change
- transit_property_change
#/$defs/transit_property_change
- transit_routing_change
#/$defs/transit_routing_change
- transit_route_addition
#/$defs/transit_route_addition
- transit_service_deletion
#/$defs/transit_service_deletion
- pycode
#/$defs/pycode
- changes
array
of Any
items. - self_obj_type
string
For calculated project cards, must refer to the object to perform the calculation on. Enumeration: RoadwayNetwork
,TransitNetwork
notes
string
- Required:
- \u201cproject\u201d
One Of:- {\u201crequired\u201d: [\u201croadway_deletion\u201d]}
- {\u201crequired\u201d: [\u201croadway_addition\u201d]}
- {\u201crequired\u201d: [\u201croadway_property_change\u201d]}
- {\u201crequired\u201d: [\u201croadway_managed_lanes\u201d]}
- {\u201crequired\u201d: [\u201ctransit_property_change\u201d]}
- {\u201crequired\u201d: [\u201ctransit_routing_change\u201d]}
- {\u201crequired\u201d: [\u201ctransit_route_addition\u201d]}
- {\u201crequired\u201d: [\u201ctransit_service_deletion\u201d]}
- {\u201crequired\u201d: [\u201cpycode\u201d]}
- {\u201crequired\u201d: [\u201cchanges\u201d]}
Project Card Schema Contents
{\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"object\",\n \"$defs\": {\n \"change_roadway_deletion\": {\n \"$ref\": \"changes/roadway_deletion.json\"\n },\n \"change_roadway_addition\": {\n \"$ref\": \"changes/roadway_addition.json\"\n },\n \"change_roadway_property_change\": {\n \"$ref\": \"changes/roadway_property_change.json\"\n },\n \"transit_property_change\": {\n \"$ref\": \"changes/transit_property_change.json\"\n },\n \"transit_routing_change\": {\n \"$ref\": \"changes/transit_routing_change.json\"\n },\n \"transit_route_addition\": {\n \"$ref\": \"changes/transit_route_addition.json\"\n },\n \"transit_service_deletion\": {\n \"$ref\": \"changes/transit_service_deletion.json\"\n },\n \"pycode\": {\n \"type\": \"string\"\n },\n \"change\": {\n \"type\": \"object\",\n \"properties\": {\n \"roadway_deletion\": {\n \"$ref\": \"#/$defs/change_roadway_deletion\"\n },\n \"roadway_addition\": {\n \"$ref\": \"#/$defs/change_roadway_addition\"\n },\n \"roadway_property_change\": {\n \"$ref\": \"#/$defs/change_roadway_property_change\"\n },\n \"transit_property_change\": {\n \"$ref\": \"#/$defs/transit_property_change\"\n },\n \"transit_routing_change\": {\n \"$ref\": \"#/$defs/transit_routing_change\"\n },\n \"transit_route_addition\": {\n \"$ref\": \"#/$defs/transit_route_addition\"\n },\n \"transit_service_deletion\": {\n \"$ref\": \"#/$defs/transit_service_deletion\"\n },\n \"pycode\": {\n \"$ref\": \"#/$defs/pycode\"\n }\n },\n \"oneOf\": [\n {\n \"required\": [\n \"roadway_deletion\"\n ]\n },\n {\n \"required\": [\n \"roadway_addition\"\n ]\n },\n {\n \"required\": [\n \"roadway_property_change\"\n ]\n },\n {\n \"required\": [\n \"transit_property_change\"\n ]\n },\n {\n \"required\": [\n \"transit_routing_change\"\n ]\n },\n {\n \"required\": [\n \"transit_route_addition\"\n ]\n },\n {\n \"required\": [\n \"transit_service_deletion\"\n ]\n },\n {\n \"required\": [\n \"pycode\"\n ]\n }\n ]\n }\n },\n \"title\": \"Project Card Schema\",\n \"required\": [\n \"project\"\n ],\n \"oneOf\": [\n {\n \"required\": [\n \"roadway_deletion\"\n ]\n },\n {\n \"required\": [\n \"roadway_addition\"\n ]\n },\n {\n \"required\": [\n \"roadway_property_change\"\n ]\n },\n {\n \"required\": [\n \"roadway_managed_lanes\"\n ]\n },\n {\n \"required\": [\n \"transit_property_change\"\n ]\n },\n {\n \"required\": [\n \"transit_routing_change\"\n ]\n },\n {\n \"required\": [\n \"transit_route_addition\"\n ]\n },\n {\n \"required\": [\n \"transit_service_deletion\"\n ]\n },\n {\n \"required\": [\n \"pycode\"\n ]\n },\n {\n \"required\": [\n \"changes\"\n ]\n }\n ],\n \"properties\": {\n \"$schema\": {\n \"type\": \"string\",\n \"description\": \"Reference to the project card schema which this file uses. If not specified, will be assumed to be the most recent release.\"\n },\n \"project\": {\n \"type\": \"string\",\n \"description\": \"A project name which uniquely identifies this project\"\n },\n \"dependencies\": {\n \"$ref\": \"defs/dependencies.json\"\n },\n \"tags\": {\n \"$ref\": \"defs/tags.json\"\n },\n \"roadway_deletion\": {\n \"$ref\": \"#/$defs/change_roadway_deletion\"\n },\n \"roadway_addition\": {\n \"$ref\": \"#/$defs/change_roadway_addition\"\n },\n \"roadway_property_change\": {\n \"$ref\": \"#/$defs/change_roadway_property_change\"\n },\n \"roadway_managed_lanes\": {\n \"$ref\": \"#/$defs/change_roadway_property_change\"\n },\n \"transit_property_change\": {\n \"$ref\": \"#/$defs/transit_property_change\"\n },\n \"transit_routing_change\": {\n \"$ref\": \"#/$defs/transit_routing_change\"\n },\n \"transit_route_addition\": {\n \"$ref\": \"#/$defs/transit_route_addition\"\n },\n \"transit_service_deletion\": {\n \"$ref\": \"#/$defs/transit_service_deletion\"\n },\n \"pycode\": {\n \"$ref\": \"#/$defs/pycode\"\n },\n \"changes\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/change\"\n }\n },\n \"self_obj_type\": {\n \"type\": \"string\",\n \"enum\": [\n \"RoadwayNetwork\",\n \"TransitNetwork\"\n ],\n \"description\": \"For calculated project cards, must refer to the object to perform the calculation on. \"\n },\n \"notes\": {\n \"type\": \"string\"\n }\n }\n}\n
"},{"location":"json-schemas/#changestransit_routing_changejson","title":"changes.transit_routing_change.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions service
../transit/selection/select_trips.json
- routing
object
- Required: - \"set\"
Required:
- \u201cservice\u201d
- \u201crouting\u201d
transit_routing_change
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"required\": [\n \"service\",\n \"routing\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"service\": {\n \"$ref\": \"../transit/selection/select_trips.json\"\n },\n \"routing\": {\n \"type\": \"object\",\n \"required\": [\n \"set\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"existing\": {\n \"type\": \"array\"\n },\n \"set\": {\n \"type\": \"array\"\n }\n }\n }\n }\n}\n
"},{"location":"json-schemas/#changestransit_property_changejson","title":"changes.transit_property_change.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions service
../transit/selection/select_trips.json
- property_changes
object
- Required:
- \u201cservice\u201d
- \u201cproperty_changes\u201d
transit_property_change
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"required\": [\n \"service\",\n \"property_changes\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"service\": {\n \"$ref\": \"../transit/selection/select_trips.json\"\n },\n \"property_changes\": {\n \"type\": \"object\",\n \"minItems\": 1,\n \"patternProperties\": {\n \".*\": {\n \"$ref\": \"defs/property_set.json\"\n }\n }\n }\n }\n}\n
"},{"location":"json-schemas/#changesroadway_property_changejson","title":"changes.roadway_property_change.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions facility
../roadway/selection/select_segment.json
- property_changes
object
- Any Of: - {\"patternProperties\": {\".*\": {\"$ref\": \"defs/property_set.json\"}}}
- {\"price\": {\"$ref\": \"defs/scoped_property_set.json\"}}
- {\"lanes\": {\"$ref\": \"defs/scoped_property_set.json\"}}
- {\"ML_price\": {\"$ref\": \"defs/scoped_property_set.json\"}}
- {\"ML_lanes\": {\"$ref\": \"defs/scoped_property_set.json\"}}
Required:
- \u201cfacility\u201d
- \u201cproperty_changes\u201d
roadway_property_change
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"required\": [\n \"facility\",\n \"property_changes\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"facility\": {\n \"$ref\": \"../roadway/selection/select_segment.json\"\n },\n \"property_changes\": {\n \"type\": \"object\",\n \"minItems\": 1,\n \"anyOf\": [\n {\n \"patternProperties\": {\n \".*\": {\n \"$ref\": \"defs/property_set.json\"\n }\n }\n },\n {\n \"price\": {\n \"$ref\": \"defs/scoped_property_set.json\"\n }\n },\n {\n \"lanes\": {\n \"$ref\": \"defs/scoped_property_set.json\"\n }\n },\n {\n \"ML_price\": {\n \"$ref\": \"defs/scoped_property_set.json\"\n }\n },\n {\n \"ML_lanes\": {\n \"$ref\": \"defs/scoped_property_set.json\"\n }\n }\n ]\n }\n }\n}\n
"},{"location":"json-schemas/#changestransit_route_additionjson","title":"changes.transit_route_addition.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions routes
array
of Any
items. - Required:
- \u201croutes\u201d
transit_route_addition
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"required\": [\n \"routes\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"routes\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../transit/transit_route.json\"\n }\n }\n }\n}\n
"},{"location":"json-schemas/#changestransit_service_deletionjson","title":"changes.transit_service_deletion.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions service
../transit/selection/select_trips.json
- clean_shapes
boolean
If true, unused shapes for these trips will be removed. Defaults to false. clean_routes
boolean
If true, unused routes for these trips will be removed. Defaults to false. Required:
- \u201cservice\u201d
- \u201cclean_shapes\u201d
- \u201cclean_routes\u201d
transit_service_deletion
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"required\": [\n \"service\",\n \"clean_shapes\",\n \"clean_routes\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"service\": {\n \"$ref\": \"../transit/selection/select_trips.json\"\n },\n \"clean_shapes\": {\n \"type\": \"boolean\",\n \"description\": \"If true, unused shapes for these trips will be removed. Defaults to false.\",\n \"default\": false\n },\n \"clean_routes\": {\n \"type\": \"boolean\",\n \"description\": \"If true, unused routes for these trips will be removed. Defaults to false.\",\n \"default\": false\n }\n }\n}\n
"},{"location":"json-schemas/#changesroadway_additionjson","title":"changes.roadway_addition.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions links
array
of Any
items. - nodes
array
of Any
items. - Any Of:
- {\u201crequired\u201d: [\u201clinks\u201d]}
- {\u201crequired\u201d: [\u201cnodes\u201d]}
roadway_addition
Example 1 {\n \"links\": [\n {\n \"A\": 1,\n \"B\": 2,\n \"model_link_id\": 123,\n \"name\": \"Elm Street\",\n \"roadway\": \"residential\",\n \"lanes\": 2,\n \"price\": 0.75,\n \"walk_access\": 1,\n \"bike_access\": 1,\n \"bike_facility\": 1,\n \"drive_access\": 1,\n \"bus_only\": 0,\n \"rail_only\": 0\n }\n ],\n \"nodes\": [\n {\n \"model_node_id\": 1,\n \"X\": -122.419,\n \"Y\": 37.7\n },\n {\n \"model_node_id\": 2,\n \"X\": -122.419,\n \"Y\": 37.8\n }\n ]\n}\n
roadway_addition
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"anyOf\": [\n {\n \"required\": [\n \"links\"\n ]\n },\n {\n \"required\": [\n \"nodes\"\n ]\n }\n ],\n \"examples\": [\n {\n \"links\": [\n {\n \"A\": 1,\n \"B\": 2,\n \"model_link_id\": 123,\n \"name\": \"Elm Street\",\n \"roadway\": \"residential\",\n \"lanes\": 2,\n \"price\": 0.75,\n \"walk_access\": 1,\n \"bike_access\": 1,\n \"bike_facility\": 1,\n \"drive_access\": 1,\n \"bus_only\": 0,\n \"rail_only\": 0\n }\n ],\n \"nodes\": [\n {\n \"model_node_id\": 1,\n \"X\": -122.419,\n \"Y\": 37.7\n },\n {\n \"model_node_id\": 2,\n \"X\": -122.419,\n \"Y\": 37.8\n }\n ]\n }\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"links\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../roadway/roadway_link.json\"\n }\n },\n \"nodes\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../roadway/roadway_node.json\"\n }\n }\n }\n}\n
"},{"location":"json-schemas/#changesroadway_deletionjson","title":"changes.roadway_deletion.json","text":"Type: Object
Additional Information:
additionalProperties: False
Properties:
Property Type Description Restrictions links
../roadway/selection/select_links.json
- nodes
../roadway/selection/select_nodes.json
- clean_shapes
boolean
If true, unused shapes for these links will be removed. Defaults to false. clean_nodes
boolean
If true, unused nodes for these links will be removed. Defaults to false. Any Of:
- {\u201crequired\u201d: [\u201clinks\u201d]}
- {\u201crequired\u201d: [\u201cnodes\u201d]}
roadway_deletion
Example 1 {\n \"links\": {\n \"model_link_id\": [\n 1,\n 2,\n 3\n ]\n }\n}\n
roadway_deletion
Example 2 {\n \"links\": {\n \"ref\": [\n \"I-5\"\n ],\n \"lanes\": 2\n }\n}\n
roadway_deletion
Example 3 {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ]\n }\n}\n
roadway_deletion
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"anyOf\": [\n {\n \"required\": [\n \"links\"\n ]\n },\n {\n \"required\": [\n \"nodes\"\n ]\n }\n ],\n \"examples\": [\n {\n \"links\": {\n \"model_link_id\": [\n 1,\n 2,\n 3\n ]\n }\n },\n {\n \"links\": {\n \"ref\": [\n \"I-5\"\n ],\n \"lanes\": 2\n }\n },\n {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ]\n }\n }\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"links\": {\n \"$ref\": \"../roadway/selection/select_links.json\"\n },\n \"nodes\": {\n \"$ref\": \"../roadway/selection/select_nodes.json\"\n },\n \"clean_shapes\": {\n \"type\": \"boolean\",\n \"description\": \"If true, unused shapes for these links will be removed. Defaults to false.\",\n \"default\": false\n },\n \"clean_nodes\": {\n \"type\": \"boolean\",\n \"description\": \"If true, unused nodes for these links will be removed. Defaults to false.\",\n \"default\": false\n }\n }\n}\n
"},{"location":"json-schemas/#changesdefsscoped_property_setjson","title":"changes.defs.scoped_property_set.json","text":"Type: Object
Definitions:
Definition Type Description Restrictions set_num
number
- change_num
number
- existing_value_conflict
string
Only used if \u2018existing\u2019 provided in project card and existing
doesn\u2019t match the existing network value. error
will raise an error, warn
will warn the user, and skip
will skip the change for that property (note it will still apply any remaining property changes). Defaults to warn
. Enumeration: error
,warn
,skip
overwrite_scoped
string
If \u2018all\u2019, all scoped items will be overwritten. If \u2018conflicting\u2019, only conflicting scoped items will be overwritten. If \u2018error\u2019, no scoped items will be overwritten and error will be raised if there are conflicts. Enumeration: all
,conflicting
,error
scoped_property_set_item
object
- One Of:- {\u201crequired\u201d: [\u201ctimespan\u201d, \u201cset\u201d]}
- {\u201crequired\u201d: [\u201ctimespan\u201d, \u201cchange\u201d]}
- {\u201crequired\u201d: [\u201ccategory\u201d, \u201cchange\u201d]}
- {\u201crequired\u201d: [\u201ccategory\u201d, \u201cset\u201d]}
Properties:
Property Type Description Restrictions existing
['number', 'string']
- set
#/$defs/set_num
- change
#/$defs/change_num
- scoped
array
of Any
items. - overwrite_scoped
#/$defs/overwrite_scoped
- existing_value_conflict
#/$defs/existing_value_conflict
- One Of:
- {\u201crequired\u201d: [\u201cset\u201d, \u201cscoped\u201d], \u201cnot\u201d: {\u201crequired\u201d: [\u201cchange\u201d]}}
- {\u201crequired\u201d: [\u201cchange\u201d, \u201cgroup\u201d], \u201cnot\u201d: {\u201crequired\u201d: [\u201cset\u201d]}}
scoped_property_set
Contents
{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"$defs\": {\n \"set_num\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"change_num\": {\n \"type\": \"number\"\n },\n \"existing_value_conflict\": {\n \"type\": \"string\",\n \"enum\": [\n \"error\",\n \"warn\",\n \"skip\"\n ],\n \"default\": \"warn\",\n \"description\": \"Only used if 'existing' provided in project card and `existing` doesn't match the existing network value. `error` will raise an error, `warn` will warn the user, and `skip` will skip the change for that property (note it will still apply any remaining property changes). Defaults to `warn`.\"\n },\n \"overwrite_scoped\": {\n \"type\": \"string\",\n \"enum\": [\n \"all\",\n \"conflicting\",\n \"error\"\n ],\n \"default\": \"error\",\n \"description\": \"If 'all', all scoped items will be overwritten. If 'conflicting', only conflicting scoped items will be overwritten. If 'error', no scoped items will be overwritten and error will be raised if there are conflicts.\"\n },\n \"scoped_property_set_item\": {\n \"type\": \"object\",\n \"examples\": [\n {\n \"timespan\": [\n \"7:00\",\n \"9:00\"\n ],\n \"set\": 0.5\n }\n ],\n \"oneOf\": [\n {\n \"required\": [\n \"timespan\",\n \"set\"\n ]\n },\n {\n \"required\": [\n \"timespan\",\n \"change\"\n ]\n },\n {\n \"required\": [\n \"category\",\n \"change\"\n ]\n },\n {\n \"required\": [\n \"category\",\n \"set\"\n ]\n }\n ],\n \"properties\": {\n \"set\": {\n \"$ref\": \"#/$defs/set_num\"\n },\n \"change\": {\n \"$ref\": \"#/$defs/change_num\"\n },\n \"category\": {\n \"type\": \"array\"\n },\n \"timespan\": {\n \"$ref\": \"../../defs/timespan.json\"\n },\n \"overwrite_scoped\": {\n \"$ref\": \"#/$defs/overwrite_scoped\"\n },\n \"existing_value_conflict\": {\n \"$ref\": \"#/$defs/existing_value_conflict\"\n }\n }\n }\n },\n \"oneOf\": [\n {\n \"required\": [\n \"set\",\n \"scoped\"\n ],\n \"not\": {\n \"required\": [\n \"change\"\n ]\n }\n },\n {\n \"required\": [\n \"change\",\n \"group\"\n ],\n \"not\": {\n \"required\": [\n \"set\"\n ]\n }\n }\n ],\n \"properties\": {\n \"existing\": {\n \"type\": [\n \"number\",\n \"string\"\n ]\n },\n \"set\": {\n \"$ref\": \"#/$defs/set_num\"\n },\n \"change\": {\n \"$ref\": \"#/$defs/change_num\"\n },\n \"scoped\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/scoped_property_set_item\"\n }\n },\n \"overwrite_scoped\": {\n \"$ref\": \"#/$defs/overwrite_scoped\"\n },\n \"existing_value_conflict\": {\n \"$ref\": \"#/$defs/existing_value_conflict\"\n }\n }\n}\n
"},{"location":"json-schemas/#changesdefsproperty_setjson","title":"changes.defs.property_set.json","text":"Type: Object
Definitions:
Definition Type Description Restrictions existing_value_conflict
string
Only used if \u2018existing\u2019 provided in project card and existing
doesn\u2019t match the existing network value. One of error
, warn
, or skip
. error
will raise an error, warn
will warn the user, and skip
will skip the change for that property (note it will still apply any remaining property changes). Will overwrite any WranglerConfig. Enumeration: error
,warn
,skip
Properties:
Property Type Description Restrictions existing
['number', 'string']
- change
['number', 'string']
- set
['number', 'string']
- existing_value_conflict
#/$defs/existing_value_conflict
- One Of:
- {\u201crequired\u201d: [\u201cchange\u201d], \u201cnot\u201d: {\u201crequired\u201d: [\u201cset\u201d]}}
- {\u201crequired\u201d: [\u201cset\u201d], \u201cnot\u201d: {\u201crequired\u201d: [\u201cchange\u201d]}}
property_set
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"$defs\": {\n \"existing_value_conflict\": {\n \"type\": \"string\",\n \"enum\": [\n \"error\",\n \"warn\",\n \"skip\"\n ],\n \"default\": \"false\",\n \"description\": \"Only used if 'existing' provided in project card and `existing` doesn't match the existing network value. One of `error`, `warn`, or `skip`. `error` will raise an error, `warn` will warn the user, and `skip` will skip the change for that property (note it will still apply any remaining property changes). Will overwrite any WranglerConfig.\"\n }\n },\n \"oneOf\": [\n {\n \"required\": [\n \"change\"\n ],\n \"not\": {\n \"required\": [\n \"set\"\n ]\n }\n },\n {\n \"required\": [\n \"set\"\n ],\n \"not\": {\n \"required\": [\n \"change\"\n ]\n }\n }\n ],\n \"properties\": {\n \"existing\": {\n \"type\": [\n \"number\",\n \"string\"\n ]\n },\n \"change\": {\n \"type\": [\n \"number\",\n \"string\"\n ]\n },\n \"set\": {\n \"type\": [\n \"number\",\n \"string\"\n ]\n },\n \"existing_value_conflict\": {\n \"$ref\": \"#/$defs/existing_value_conflict\"\n }\n }\n}\n
"},{"location":"json-schemas/#defsdependenciesjson","title":"defs.dependencies.json","text":"Type: Object
Additional Information:
-
additionalProperties: False
-
title: Project Dependencies
Properties:
Property Type Description Restrictions prerequisites
array
Project Prerequisites corequisites
array
Project Co-requisites conflicts
array
Project Conflicts Project Dependencies Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"title\": \"Project Dependencies\",\n \"properties\": {\n \"prerequisites\": {\n \"type\": \"array\",\n \"title\": \"Project Prerequisites\",\n \"examples\": [\n \"7th St E Road Diet\"\n ]\n },\n \"corequisites\": {\n \"type\": \"array\",\n \"title\": \"Project Co-requisites\",\n \"examples\": [\n \"7th St E Road Diet\"\n ]\n },\n \"conflicts\": {\n \"type\": \"array\",\n \"title\": \"Project Conflicts\",\n \"examples\": [\n \"7th St E Road Diet\"\n ]\n }\n }\n}\n
"},{"location":"json-schemas/#defsmodejson","title":"defs.mode.json","text":"Additional Information:
title: mode
Enumeration: drive
,walk
,bike
,transit
,any
mode Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"string\",\n \"title\": \"mode\",\n \"enum\": [\n \"drive\",\n \"walk\",\n \"bike\",\n \"transit\",\n \"any\"\n ]\n}\n
"},{"location":"json-schemas/#defstimejson","title":"defs.time.json","text":"Additional Information:
pattern: ^([0-9]|0[0-9]|1[0-9]|2[0-3]):0-5(:0-5)?$
time
Example 1 \"12:34\"\n
time
Example 2 \"12:34:56\"\n
time
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"string\",\n \"pattern\": \"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$\",\n \"examples\": [\n \"12:34\",\n \"12:34:56\"\n ]\n}\n
"},{"location":"json-schemas/#defstagsjson","title":"defs.tags.json","text":"Type: array
of string
items.
Property Value examples - \"vision2050\"
uniqueItems True Project Tags Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"array\",\n \"title\": \"Project Tags\",\n \"items\": {\n \"type\": \"string\",\n \"examples\": [\n \"vision2050\"\n ],\n \"uniqueItems\": true\n }\n}\n
"},{"location":"json-schemas/#defstimespanjson","title":"defs.timespan.json","text":"Type: array
of Any
items.
timespan
Example 1 [\n \"12:00\",\n \"19:45:00\"\n]\n
timespan
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"examples\": [\n [\n \"12:00\",\n \"19:45:00\"\n ]\n ],\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"time.json\"\n },\n \"minItems\": 2,\n \"maxItems\": 2\n}\n
"},{"location":"json-schemas/#roadwayroadway_nodejson","title":"roadway.roadway_node.json","text":"Type: Object
Additional Information:
-
description: Requirements for roadway nodes.
-
title: Roadway nodes
Definitions:
Definition Type Description Restrictions model_node_id
integer
Primary key to the nodes object. point
array
of Any
items. The Point Schema X
number
X coordinate (e.g. Longitude) Y
number
Y coordinate (e.g. Latitude) Z
number
Z coordinate (e.g. Altitude) osm_node_id
string
Reference to the corresponding Open Street Map node. shstReferenceId_node
string
Shared streets node ID reference. walk_node
['integer', 'boolean']
Indicates node is part of the pedestrian network. Useful for exporting or querying networks by mode. bike_node
['integer', 'boolean']
Indicates node is part of the bike network. Useful for exporting or querying networks by mode. drive_node
['integer', 'boolean']
Indicates node is part of the driving network. Useful for exporting or querying networks by mode. transit_node
['integer', 'boolean']
Indicates node is part of the transit network. Useful for exporting or querying networks by mode. Properties:
Property Type Description Restrictions model_node_id
#/$defs/model_node_id
- osm_node_id
#/$defs/osm_node_id
- shstReferenceId
#/$defs/shstReferenceId_node
- outboundReferenceIds
array
of Any
items. - inboundReferenceIds
array
of Any
items. - walk_node
#/$defs/walk_node
- bike_node
#/$defs/bike_node
- drive_node
#/$defs/drive_node
- transit_node
#/$defs/transit_node
- X
#/$defs/X
- Y
#/$defs/Y
- Z
#/$defs/Z
- Required:
- \u201cmodel_node_id\u201d
- \u201cX\u201d
- \u201cY\u201d
Roadway nodes Example 1 {\n \"model_node_id\": 1,\n \"X\": -122.419,\n \"Y\": 37.774\n}\n
Roadway nodes Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Requirements for roadway nodes.\",\n \"type\": \"object\",\n \"$defs\": {\n \"model_node_id\": {\n \"type\": \"integer\",\n \"uniqueItems\": true,\n \"description\": \"Primary key to the nodes object.\"\n },\n \"point\": {\n \"type\": \"array\",\n \"description\": \"The Point Schema\",\n \"minItems\": 2,\n \"maxItems\": 3,\n \"prefixItems\": [\n {\n \"$ref\": \"#/$defs/X\"\n },\n {\n \"$ref\": \"#/$defs/Y\"\n }\n ],\n \"items\": {\n \"$ref\": \"#/$defs/Z\"\n }\n },\n \"X\": {\n \"type\": \"number\",\n \"description\": \"X coordinate (e.g. Longitude)\"\n },\n \"Y\": {\n \"type\": \"number\",\n \"description\": \"Y coordinate (e.g. Latitude)\"\n },\n \"Z\": {\n \"type\": \"number\",\n \"description\": \"Z coordinate (e.g. Altitude)\"\n },\n \"osm_node_id\": {\n \"type\": \"string\",\n \"examples\": [\n \"954734870\"\n ],\n \"description\": \"Reference to the corresponding Open Street Map node.\"\n },\n \"shstReferenceId_node\": {\n \"type\": \"string\",\n \"examples\": [\n \"0751f5ce12472360fed0d0e80ceae35c\"\n ],\n \"description\": \"Shared streets node ID reference.\"\n },\n \"walk_node\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates node is part of the pedestrian network. Useful for exporting or querying networks by mode.\"\n },\n \"bike_node\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates node is part of the bike network. Useful for exporting or querying networks by mode.\"\n },\n \"drive_node\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates node is part of the driving network. Useful for exporting or querying networks by mode.\"\n },\n \"transit_node\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates node is part of the transit network. Useful for exporting or querying networks by mode.\"\n }\n },\n \"title\": \"Roadway nodes\",\n \"required\": [\n \"model_node_id\",\n \"X\",\n \"Y\"\n ],\n \"examples\": [\n {\n \"model_node_id\": 1,\n \"X\": -122.419,\n \"Y\": 37.774\n }\n ],\n \"properties\": {\n \"model_node_id\": {\n \"$ref\": \"#/$defs/model_node_id\"\n },\n \"osm_node_id\": {\n \"$ref\": \"#/$defs/osm_node_id\"\n },\n \"shstReferenceId\": {\n \"$ref\": \"#/$defs/shstReferenceId_node\"\n },\n \"outboundReferenceIds\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"roadway_link.json#/$defs/shstReferenceId_link\"\n }\n },\n \"inboundReferenceIds\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"roadway_link.json#/$defs/shstReferenceId_link\"\n }\n },\n \"walk_node\": {\n \"$ref\": \"#/$defs/walk_node\"\n },\n \"bike_node\": {\n \"$ref\": \"#/$defs/bike_node\"\n },\n \"drive_node\": {\n \"$ref\": \"#/$defs/drive_node\"\n },\n \"transit_node\": {\n \"$ref\": \"#/$defs/transit_node\"\n },\n \"X\": {\n \"$ref\": \"#/$defs/X\"\n },\n \"Y\": {\n \"$ref\": \"#/$defs/Y\"\n },\n \"Z\": {\n \"$ref\": \"#/$defs/Z\"\n }\n }\n}\n
"},{"location":"json-schemas/#roadwayroadway_linkjson","title":"roadway.roadway_link.json","text":"Type: Object
Additional Information:
-
description: Requirements for roadway links.
-
title: Roadway links
Definitions:
Definition Type Description Restrictions node
integer
Foreign key to the nodes object. intersectionId
string
The Intersectionid Schema shstReferenceId_link
string
The Shstreferenceid Schema shstGeometryId
string
The Shstgeometryid Schema bearing
integer
The angle of the eminating arc from the point, expressed in clockwise degrees from North (0) point
Any
- distance
number
Distance of facility in miles. If not provided, will be calculated provided nodes name
string
Name of Roadway facility. If multiple, can be contatenated with a comma. ref
string
Reference name of roadway, per Open Street Map definition. model_link_id
integer
Unique id for facility. osm_link_id
string
Reference to the corresponding Open Street Map link. Note that due to link splitting this may or may not be unique, and is not a required attribute. roadway
string
Roadway type, using OSM Highway values. Notes: * X_link
roadway types denote linkage roads going to/from roadway type X (i.e. on/off ramps, etc). * road
denotes unknown type. Enumeration: 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
locationReference
object
- Required:- \u201csequence\u201d
- \u201cpoint\u201d
locationReferences
array
of Any
items. The Locationreferences Schema scoped_number_property_value
Any
- One Of:- {\u201c$ref\u201d: \u201c#/$defs/number_property.by_time-of-day\u201d}
- {\u201c$ref\u201d: \u201c#/$defs/number_property.by_access-category\u201d}
- {\u201c$ref\u201d: \u201c#/$defs/number_property.by_access-category-and-time-of-day\u201d}
lanes
Any
Number of lanes either in simple or complex terms. One Of:- {\u201ctype\u201d: \u201cnumber\u201d, \u201cminimum\u201d: 0}
- {\u201c$ref\u201d: \u201c#/$defs/scoped_number_property_value\u201d}
ML_lanes
#/$defs/lanes
Lanes for a parallel managed lane facility. number_property.by_time-of-day
object
- Required:- \u201cdefault\u201d
- \u201ctimeofday\u201d
number_property.by_access-category
object
- Required:- \u201cdefault\u201d
- \u201cgroups\u201d
number_property.by_access-category-and-time-of-day
object
- Required:- \u201cdefault\u201d
- \u201ctimeofday\u201d
price
Any
Price of facility, either as a positive number of a complex type by time of day and/or access category. One Of:- {\u201ctype\u201d: \u201cnumber\u201d, \u201cminimum\u201d: 0}
- {\u201c$ref\u201d: \u201c#/$defs/scoped_number_property_value\u201d}
ML_price
#/$defs/price
Price for a parallel managed lane facility. walk_access
['integer', 'boolean']
Indicates if a facility is generally available for pedestrians. Must not be true if any of bus_only or rail_only are true. bike_access
['integer', 'boolean']
Indicates if a facility is generally available for cyclists. Must not be true if any of bus_only or rail_only are true. bike_facility
integer
Indicator for the category of bicycle facility on or along the roadway. If null, indicates unknown. If zero, indicates no facility. drive_access
['integer', 'boolean']
Indicates if a facility is generally available for driving. Must not be true if any of bus_only or rail_only are true. bus_only
['integer', 'boolean']
Indicates if a facility is rail-only if True. Must not be true if any of walk_access, bike_access, drive_access, rail_only are True. rail_only
['integer', 'boolean']
Indicates if a facility is rail-only if True. Must not be true if any of walk_access, bike_access, drive_access, bus_only are True. segment_id
['string', 'integer']
An identifier for segments of roadway. Can be useful for querying and setting values for parts of facilities, summary scripts, etc. ML_access_egress
Any
Indicates where a managed lane facility can by accessed or exited either by indicating all
for everywhere, or listing foreign keys to specific A-nodes. One Of:- {\u201ctype\u201d: \u201cstring\u201d, \u201cvalue\u201d: \u201call\u201d}
- {\u201ctype\u201d: \u201carray\u201d, \u201citems\u201d: {\u201c$ref\u201d: \u201c#/$defs/node\u201d}, \u201cminItems\u201d: 1}
Properties:
Property Type Description Restrictions A
#/$defs/node
- B
#/$defs/node
- model_link_id
#/$defs/model_link_id
- osm_link_id
#/$defs/osm_link_id
- shstReferenceId
#/$defs/shstReferenceId_link
- shstGeometryId
#/$defs/shstGeometryId
- locationReferences
#/$defs/locationReferences
- name
#/$defs/name
- ref
#/$defs/ref
- roadway
#/$defs/roadway
- lanes
#/$defs/lanes
- price
#/$defs/price
- ML_lanes
#/$defs/lanes
- ML_price
#/$defs/ML_price
- ML_access_point
#/$defs/ML_access_egress
- ML_egress_point
#/$defs/ML_access_egress
- walk_access
#/$defs/walk_access
- bike_access
#/$defs/bike_access
- bike_facility
#/$defs/bike_facility
- drive_access
#/$defs/drive_access
- bus_only
#/$defs/bus_only
- rail_only
#/$defs/rail_only
- segment_id
#/$defs/segment_id
- ignore_missing
boolean
- all
boolean
- Required:
- \u201cA\u201d
- \u201cB\u201d
- \u201cname\u201d
- \u201cmodel_link_id\u201d
- \u201croadway\u201d
- \u201clanes\u201d
- \u201cwalk_access\u201d
- \u201cbike_access\u201d
- \u201cdrive_access\u201d
Roadway links Example 1
{\n \"A\": 123,\n \"B\": 5543,\n \"model_link_id\": 123,\n \"name\": \"Elm Street\",\n \"roadway\": \"residential\",\n \"lanes\": 2,\n \"price\": 0.75,\n \"walk_access\": 1,\n \"bike_access\": 1,\n \"bike_facility\": 1,\n \"drive_access\": 1,\n \"bus_only\": 0,\n \"rail_only\": 0\n}\n
Roadway links Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Requirements for roadway links.\",\n \"type\": \"object\",\n \"$defs\": {\n \"node\": {\n \"type\": \"integer\",\n \"description\": \"Foreign key to the nodes object.\"\n },\n \"intersectionId\": {\n \"type\": \"string\",\n \"description\": \"The Intersectionid Schema\",\n \"examples\": [\n \"4d0231aa0ebb779f142c2518703ee481\"\n ]\n },\n \"shstReferenceId_link\": {\n \"type\": \"string\",\n \"description\": \"The Shstreferenceid Schema\",\n \"examples\": [\n \"6a22969708104ae2497244f3d079381d\"\n ]\n },\n \"shstGeometryId\": {\n \"type\": \"string\",\n \"description\": \"The Shstgeometryid Schema\",\n \"examples\": [\n \"6a22969708104ae2497244f3d079381d\"\n ]\n },\n \"bearing\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 360,\n \"description\": \"The angle of the eminating arc from the point, expressed in clockwise degrees from North (0)\",\n \"examples\": [\n 0,\n 90,\n 275\n ]\n },\n \"point\": {\n \"#ref\": \"roadway_node.json#/$defs/roadway_nodes_point\"\n },\n \"distance\": {\n \"type\": \"number\",\n \"title\": \"Distance\",\n \"description\": \"Distance of facility in miles. If not provided, will be calculated provided nodes\",\n \"minimum\": 0,\n \"examples\": [\n 93.08\n ]\n },\n \"name\": {\n \"type\": \"string\",\n \"examples\": [\n \"Elm Street\",\n \"Raleigh Beltline\",\n \"Capital Beltway\",\n \"3rd St,Willie Mays Blvd\"\n ],\n \"description\": \"Name of Roadway facility. If multiple, can be contatenated with a comma.\"\n },\n \"ref\": {\n \"type\": \"string\",\n \"examples\": [\n \"I-40\",\n \"US66\",\n \"WA520\"\n ],\n \"description\": \"Reference name of roadway, per Open Street Map definition.\"\n },\n \"model_link_id\": {\n \"type\": \"integer\",\n \"description\": \"Unique id for facility.\"\n },\n \"osm_link_id\": {\n \"type\": \"string\",\n \"description\": \"Reference to the corresponding Open Street Map link. Note that due to link splitting this may or may not be unique, and is not a required attribute.\"\n },\n \"roadway\": {\n \"type\": \"string\",\n \"enum\": [\n \"taz\",\n \"motorway\",\n \"trunk\",\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"unclassified\",\n \"residential\",\n \"motorway_link\",\n \"trunk_link\",\n \"primary_link\",\n \"secondary_link\",\n \"tertiary_link\",\n \"living_street\",\n \"service\",\n \"pedestrian\",\n \"footway\",\n \"steps\",\n \"cycleway\",\n \"track\",\n \"bus_guideway\",\n \"road\"\n ],\n \"default\": \"road\",\n \"description\": \"Roadway type, using [OSM Highway values](https://wiki.openstreetmap.org/wiki/Key:highway#Roads). Notes: * `X_link` roadway types denote linkage roads going to/from roadway type X (i.e. on/off ramps, etc). * `road` denotes unknown type.\"\n },\n \"locationReference\": {\n \"type\": \"object\",\n \"required\": [\n \"sequence\",\n \"point\"\n ],\n \"properties\": {\n \"sequence\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"point\": {\n \"$ref\": \"#/$defs/point\"\n },\n \"distanceToNextRef\": {\n \"$ref\": \"#/$defs/distance\"\n },\n \"bearing\": {\n \"$ref\": \"#/$defs/bearing\"\n },\n \"intersectionId\": {\n \"$ref\": \"#/$defs/intersectionId\"\n }\n }\n },\n \"locationReferences\": {\n \"type\": \"array\",\n \"description\": \"The Locationreferences Schema\",\n \"items\": {\n \"$ref\": \"#/$defs/locationReference\"\n }\n },\n \"scoped_number_property_value\": {\n \"oneOf\": [\n {\n \"$ref\": \"#/$defs/number_property.by_time-of-day\"\n },\n {\n \"$ref\": \"#/$defs/number_property.by_access-category\"\n },\n {\n \"$ref\": \"#/$defs/number_property.by_access-category-and-time-of-day\"\n }\n ]\n },\n \"lanes\": {\n \"oneOf\": [\n {\n \"type\": \"number\",\n \"minimum\": 0\n },\n {\n \"$ref\": \"#/$defs/scoped_number_property_value\"\n }\n ],\n \"examples\": [\n 2,\n 5,\n {\n \"default\": 1,\n \"timeofday\": {\n \"timespan\": [\n \"6:00\",\n \"9:00\"\n ],\n \"value\": 2\n }\n }\n ],\n \"description\": \"Number of lanes either in simple or complex terms.\"\n },\n \"ML_lanes\": {\n \"$ref\": \"#/$defs/lanes\",\n \"description\": \"Lanes for a parallel managed lane facility.\"\n },\n \"number_property.by_time-of-day\": {\n \"type\": \"object\",\n \"examples\": [\n {\n \"default\": 1,\n \"timeofday\": [\n {\n \"timespan\": [\n \"7:00\",\n \"9:00\"\n ],\n \"value\": 0.5\n }\n ]\n }\n ],\n \"required\": [\n \"default\",\n \"timeofday\"\n ],\n \"properties\": {\n \"default\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"timeofday\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"timespan\",\n \"value\"\n ],\n \"properties\": {\n \"timespan\": {\n \"$ref\": \"../defs/timespan.json\"\n },\n \"value\": {\n \"type\": \"number\",\n \"minimum\": 0\n }\n }\n }\n }\n }\n },\n \"number_property.by_access-category\": {\n \"type\": \"object\",\n \"required\": [\n \"default\",\n \"groups\"\n ],\n \"examples\": [\n {\n \"default\": 1,\n \"groups\": [\n {\n \"category\": [\n \"HOV2\"\n ],\n \"value\": 0.5\n }\n ]\n }\n ],\n \"properties\": {\n \"default\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"group\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"category\",\n \"value\"\n ],\n \"properties\": {\n \"category\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"value\": {\n \"type\": \"number\",\n \"minimum\": 0\n }\n }\n }\n }\n }\n },\n \"number_property.by_access-category-and-time-of-day\": {\n \"type\": \"object\",\n \"required\": [\n \"default\",\n \"timeofday\"\n ],\n \"examples\": [\n {\n \"default\": 1,\n \"timeofday\": [\n {\n \"timespan\": [\n \"7:00\",\n \"9:00\"\n ],\n \"category\": [\n \"HOV2\"\n ],\n \"value\": 0.5\n }\n ]\n }\n ],\n \"properties\": {\n \"default\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"timeofday\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"category\",\n \"timespan\",\n \"value\"\n ],\n \"properties\": {\n \"category\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"timespan\": {\n \"$ref\": \"../defs/timespan.json\"\n },\n \"value\": {\n \"type\": \"number\",\n \"minimum\": 0\n }\n }\n }\n }\n }\n },\n \"price\": {\n \"oneOf\": [\n {\n \"type\": \"number\",\n \"minimum\": 0\n },\n {\n \"$ref\": \"#/$defs/scoped_number_property_value\"\n }\n ],\n \"default\": 0,\n \"examples\": [\n 0.75,\n 2.9,\n {\n \"default\": 1,\n \"timeofday\": {\n \"time\": [\n \"6:00\",\n \"9:00\"\n ],\n \"value\": 2\n }\n }\n ],\n \"description\": \"Price of facility, either as a positive number of a complex type by time of day and/or access category.\"\n },\n \"ML_price\": {\n \"$ref\": \"#/$defs/price\",\n \"description\": \"Price for a parallel managed lane facility.\"\n },\n \"walk_access\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates if a facility is generally available for pedestrians. Must not be true if any of bus_only or rail_only are true.\"\n },\n \"bike_access\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates if a facility is generally available for cyclists. Must not be true if any of bus_only or rail_only are true.\"\n },\n \"bike_facility\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"description\": \"Indicator for the category of bicycle facility on or along the roadway. If null, indicates unknown. If zero, indicates no facility.\"\n },\n \"drive_access\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"description\": \"Indicates if a facility is generally available for driving. Must not be true if any of bus_only or rail_only are true.\"\n },\n \"bus_only\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"default\": 0,\n \"description\": \"Indicates if a facility is rail-only if True. Must not be true if any of walk_access, bike_access, drive_access, rail_only are True.\"\n },\n \"rail_only\": {\n \"type\": [\n \"integer\",\n \"boolean\"\n ],\n \"default\": 0,\n \"description\": \"Indicates if a facility is rail-only if True. Must not be true if any of walk_access, bike_access, drive_access, bus_only are True.\"\n },\n \"segment_id\": {\n \"type\": [\n \"string\",\n \"integer\"\n ],\n \"description\": \"An identifier for segments of roadway. Can be useful for querying and setting values for parts of facilities, summary scripts, etc.\"\n },\n \"ML_access_egress\": {\n \"oneOf\": [\n {\n \"type\": \"string\",\n \"value\": \"all\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/node\"\n },\n \"minItems\": 1\n }\n ],\n \"examples\": [\n \"all\",\n [\n 123,\n 5543\n ]\n ],\n \"description\": \"Indicates where a managed lane facility can by accessed or exited either by indicating `all` for everywhere, or listing foreign keys to specific A-nodes.\"\n }\n },\n \"title\": \"Roadway links\",\n \"required\": [\n \"A\",\n \"B\",\n \"name\",\n \"model_link_id\",\n \"roadway\",\n \"lanes\",\n \"walk_access\",\n \"bike_access\",\n \"drive_access\"\n ],\n \"examples\": [\n {\n \"A\": 123,\n \"B\": 5543,\n \"model_link_id\": 123,\n \"name\": \"Elm Street\",\n \"roadway\": \"residential\",\n \"lanes\": 2,\n \"price\": 0.75,\n \"walk_access\": 1,\n \"bike_access\": 1,\n \"bike_facility\": 1,\n \"drive_access\": 1,\n \"bus_only\": 0,\n \"rail_only\": 0\n }\n ],\n \"properties\": {\n \"A\": {\n \"$ref\": \"#/$defs/node\"\n },\n \"B\": {\n \"$ref\": \"#/$defs/node\"\n },\n \"model_link_id\": {\n \"$ref\": \"#/$defs/model_link_id\"\n },\n \"osm_link_id\": {\n \"$ref\": \"#/$defs/osm_link_id\"\n },\n \"shstReferenceId\": {\n \"$ref\": \"#/$defs/shstReferenceId_link\"\n },\n \"shstGeometryId\": {\n \"$ref\": \"#/$defs/shstGeometryId\"\n },\n \"locationReferences\": {\n \"$ref\": \"#/$defs/locationReferences\"\n },\n \"name\": {\n \"$ref\": \"#/$defs/name\"\n },\n \"ref\": {\n \"$ref\": \"#/$defs/ref\"\n },\n \"roadway\": {\n \"$ref\": \"#/$defs/roadway\"\n },\n \"lanes\": {\n \"$ref\": \"#/$defs/lanes\"\n },\n \"price\": {\n \"$ref\": \"#/$defs/price\"\n },\n \"ML_lanes\": {\n \"$ref\": \"#/$defs/lanes\"\n },\n \"ML_price\": {\n \"$ref\": \"#/$defs/ML_price\"\n },\n \"ML_access_point\": {\n \"$ref\": \"#/$defs/ML_access_egress\"\n },\n \"ML_egress_point\": {\n \"$ref\": \"#/$defs/ML_access_egress\"\n },\n \"walk_access\": {\n \"$ref\": \"#/$defs/walk_access\"\n },\n \"bike_access\": {\n \"$ref\": \"#/$defs/bike_access\"\n },\n \"bike_facility\": {\n \"$ref\": \"#/$defs/bike_facility\"\n },\n \"drive_access\": {\n \"$ref\": \"#/$defs/drive_access\"\n },\n \"bus_only\": {\n \"$ref\": \"#/$defs/bus_only\"\n },\n \"rail_only\": {\n \"$ref\": \"#/$defs/rail_only\"\n },\n \"segment_id\": {\n \"$ref\": \"#/$defs/segment_id\"\n },\n \"ignore_missing\": {\n \"type\": \"boolean\"\n },\n \"all\": {\n \"type\": \"boolean\"\n }\n }\n}\n
"},{"location":"json-schemas/#roadwayselectionselect_linksjson","title":"roadway.selection.select_links.json","text":"Type: Object
Additional Information:
-
description: requirements for describing links in the facility
section of a project card.
-
title: Roadway link selection
-
additionalProperties: True
-
not: {\u2018anyOf\u2019: [{\u2018required\u2019: [\u2018from\u2019]}, {\u2018required\u2019: [\u2018to\u2019]}]}
Properties:
Property Type Description Restrictions all
Any
- Enumeration: True
,False
name
array
of Any
items. - ref
array
of Any
items. - osm_link_id
array
of Any
items. - model_link_id
array
of Any
items. - modes
array
of Any
items. - ignore_missing
boolean
If true, missing links for explicit ID selections will be ignored. Defaults to true. Required:
- \u201cignore_missing\u201d
One Of:- {\u201crequired\u201d: [\u201cname\u201d]}
- {\u201crequired\u201d: [\u201cref\u201d]}
- {\u201crequired\u201d: [\u201cosm_link_id\u201d]}
- {\u201crequired\u201d: [\u201cmodel_link_id\u201d]}
- {\u201crequired\u201d: [\u201call\u201d]}
Roadway link selection Example 1 {\n \"name\": [\n \"Main St\"\n ],\n \"modes\": [\n \"drive\"\n ]\n}\n
Roadway link selection Example 2 {\n \"osm_link_id\": [\n \"123456789\"\n ]\n}\n
Roadway link selection Example 3 {\n \"model_link_id\": [\n 123456789\n ],\n \"modes\": [\n \"walk\"\n ]\n}\n
Roadway link selection Example 4 {\n \"all\": \"True\",\n \"modes\": [\n \"transit\"\n ]\n}\n
Roadway link selection Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"requirements for describing links in the `facility` section of a project card.\",\n \"type\": \"object\",\n \"title\": \"Roadway link selection\",\n \"required\": [\n \"ignore_missing\"\n ],\n \"oneOf\": [\n {\n \"required\": [\n \"name\"\n ]\n },\n {\n \"required\": [\n \"ref\"\n ]\n },\n {\n \"required\": [\n \"osm_link_id\"\n ]\n },\n {\n \"required\": [\n \"model_link_id\"\n ]\n },\n {\n \"required\": [\n \"all\"\n ]\n }\n ],\n \"additionalProperties\": true,\n \"not\": {\n \"anyOf\": [\n {\n \"required\": [\n \"from\"\n ]\n },\n {\n \"required\": [\n \"to\"\n ]\n }\n ]\n },\n \"examples\": [\n {\n \"name\": [\n \"Main St\"\n ],\n \"modes\": [\n \"drive\"\n ]\n },\n {\n \"osm_link_id\": [\n \"123456789\"\n ]\n },\n {\n \"model_link_id\": [\n 123456789\n ],\n \"modes\": [\n \"walk\"\n ]\n },\n {\n \"all\": \"True\",\n \"modes\": [\n \"transit\"\n ]\n }\n ],\n \"properties\": {\n \"all\": {\n \"enum\": [\n \"True\",\n \"False\"\n ]\n },\n \"name\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_link.json#/$defs/name\"\n }\n },\n \"ref\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_link.json#/$defs/ref\"\n }\n },\n \"osm_link_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_link.json#/$defs/osm_link_id\"\n }\n },\n \"model_link_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_link.json#/$defs/model_link_id\"\n }\n },\n \"modes\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../../defs/mode.json\"\n }\n },\n \"ignore_missing\": {\n \"type\": \"boolean\",\n \"description\": \"If true, missing links for explicit ID selections will be ignored. Defaults to true.\",\n \"default\": true\n }\n }\n}\n
"},{"location":"json-schemas/#roadwayselectionselect_segmentjson","title":"roadway.selection.select_segment.json","text":"Type: Object
Additional Information:
-
id: facility_roadway
-
additionalProperties: False
-
title: Roadway Facility Selection
Properties:
Property Type Description Restrictions links
select_links.json
- nodes
select_nodes.json
- from
select_node.json
- to
select_node.json
- Any Of:
- {\u201crequired\u201d: [\u201clinks\u201d, \u201cfrom\u201d, \u201cto\u201d]}
- {\u201crequired\u201d: [\u201clinks\u201d]}
- {\u201crequired\u201d: [\u201cnodes\u201d]}
Roadway Facility Selection Example 1 {\n \"links\": {\n \"name\": [\n \"Main Street\"\n ]\n },\n \"from\": {\n \"model_node_id\": 1\n },\n \"to\": {\n \"model_node_id\": 2\n }\n}\n
Roadway Facility Selection Example 2 {\n \"nodes\": {\n \"osm_node_id\": [\n \"1\",\n \"2\",\n \"3\"\n ]\n }\n}\n
Roadway Facility Selection Example 3 {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ]\n }\n}\n
Roadway Facility Selection Example 4 {\n \"links\": {\n \"model_link_id\": [\n 1,\n 2,\n 3\n ]\n }\n}\n
Roadway Facility Selection Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"object\",\n \"id\": \"facility_roadway\",\n \"additionalProperties\": false,\n \"anyOf\": [\n {\n \"required\": [\n \"links\",\n \"from\",\n \"to\"\n ]\n },\n {\n \"required\": [\n \"links\"\n ]\n },\n {\n \"required\": [\n \"nodes\"\n ]\n }\n ],\n \"title\": \"Roadway Facility Selection\",\n \"examples\": [\n {\n \"links\": {\n \"name\": [\n \"Main Street\"\n ]\n },\n \"from\": {\n \"model_node_id\": 1\n },\n \"to\": {\n \"model_node_id\": 2\n }\n },\n {\n \"nodes\": {\n \"osm_node_id\": [\n \"1\",\n \"2\",\n \"3\"\n ]\n }\n },\n {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ]\n }\n },\n {\n \"links\": {\n \"model_link_id\": [\n 1,\n 2,\n 3\n ]\n }\n }\n ],\n \"properties\": {\n \"links\": {\n \"$ref\": \"select_links.json\"\n },\n \"nodes\": {\n \"$ref\": \"select_nodes.json\"\n },\n \"from\": {\n \"$ref\": \"select_node.json\"\n },\n \"to\": {\n \"$ref\": \"select_node.json\"\n }\n }\n}\n
"},{"location":"json-schemas/#roadwayselectionselect_nodejson","title":"roadway.selection.select_node.json","text":"Type: Object
Additional Information:
-
description: Selection of a single roadway node in the facility
section of a project card.
-
title: Single roadway network node
-
additionalProperties: False
Properties:
Property Type Description Restrictions osm_node_id
../roadway_node.json#/$defs/osm_node_id
- model_node_id
../roadway_node.json#/$defs/model_node_id
- One Of:
- {\u201crequired\u201d: [\u201cosm_node_id\u201d]}
- {\u201crequired\u201d: [\u201cmodel_node_id\u201d]}
Single roadway network node Example 1 {\n \"osm_node_id\": \"12345\"\n}\n
Single roadway network node Example 2 {\n \"model_node_id\": 67890\n}\n
Single roadway network node Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"object\",\n \"description\": \"Selection of a single roadway node in the `facility` section of a project card.\",\n \"title\": \"Single roadway network node\",\n \"additionalProperties\": false,\n \"oneOf\": [\n {\n \"required\": [\n \"osm_node_id\"\n ]\n },\n {\n \"required\": [\n \"model_node_id\"\n ]\n }\n ],\n \"examples\": [\n {\n \"osm_node_id\": \"12345\"\n },\n {\n \"model_node_id\": 67890\n }\n ],\n \"properties\": {\n \"osm_node_id\": {\n \"$ref\": \"../roadway_node.json#/$defs/osm_node_id\"\n },\n \"model_node_id\": {\n \"$ref\": \"../roadway_node.json#/$defs/model_node_id\"\n }\n }\n}\n
"},{"location":"json-schemas/#roadwayselectionselect_nodesjson","title":"roadway.selection.select_nodes.json","text":"Type: Object
Additional Information:
-
description: requirements for describing multiple nodes of a project card (e.g. to delete).
-
additionalProperties: False
-
title: Roadway network node
Properties:
Property Type Description Restrictions osm_node_id
array
of Any
items. - model_node_id
array
of Any
items. - ignore_missing
boolean
If true, missing nodes for explicit ID selections will be ignored. Defaults to true. all
boolean
- Required:
- \u201cignore_missing\u201d
Any Of:- {\u201crequired\u201d: [\u201cosm_node_id\u201d]}
- {\u201crequired\u201d: [\u201cmodel_node_id\u201d]}
Roadway network node Example 1 {\n \"osm_node_id\": [\n \"12345\",\n \"67890\"\n ],\n \"model_node_id\": [\n 12345,\n 67890\n ]\n}\n
Roadway network node Example 2 {\n \"osm_node_id\": [\n \"12345\",\n \"67890\"\n ]\n}\n
Roadway network node Example 3 {\n \"model_node_id\": [\n 12345,\n 67890\n ]\n}\n
Roadway network node Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"requirements for describing multiple nodes of a project card (e.g. to delete).\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"title\": \"Roadway network node\",\n \"required\": [\n \"ignore_missing\"\n ],\n \"anyOf\": [\n {\n \"required\": [\n \"osm_node_id\"\n ]\n },\n {\n \"required\": [\n \"model_node_id\"\n ]\n }\n ],\n \"examples\": [\n {\n \"osm_node_id\": [\n \"12345\",\n \"67890\"\n ],\n \"model_node_id\": [\n 12345,\n 67890\n ]\n },\n {\n \"osm_node_id\": [\n \"12345\",\n \"67890\"\n ]\n },\n {\n \"model_node_id\": [\n 12345,\n 67890\n ]\n }\n ],\n \"properties\": {\n \"osm_node_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_node.json#/$defs/osm_node_id\"\n }\n },\n \"model_node_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../roadway_node.json#/$defs/model_node_id\"\n }\n },\n \"ignore_missing\": {\n \"type\": \"boolean\",\n \"description\": \"If true, missing nodes for explicit ID selections will be ignored. Defaults to true.\",\n \"default\": true\n },\n \"all\": {\n \"type\": \"boolean\"\n }\n }\n}\n
"},{"location":"json-schemas/#transittransit_stopjson","title":"transit.transit_stop.json","text":"Type: Object
Additional Information:
-
description: Transit stop properties.
-
additionalProperties: True
Definitions:
Definition Type Description Restrictions stop_id
string
ID for specific transit stop. Properties:
Property Type Description Restrictions stop_id
#/$defs/stop_id
- transit_stop
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Transit stop properties.\",\n \"type\": \"object\",\n \"$defs\": {\n \"stop_id\": {\n \"type\": \"string\",\n \"description\": \"ID for specific transit stop.\"\n }\n },\n \"additionalProperties\": true,\n \"properties\": {\n \"stop_id\": {\n \"$ref\": \"#/$defs/stop_id\"\n }\n }\n}\n
"},{"location":"json-schemas/#transittransit_routejson","title":"transit.transit_route.json","text":"Type: Object
Additional Information:
description: Transit service properties.
Definitions:
Definition Type Description Restrictions agency_id
string
ID for agency. route_id
string
ID for general route. route_short_name
string
Route short name. route_long_name
string
Route long name. route_type
integer
Route type. Enumeration: 0
,1
,2
,3
,4
,5
,6
,7
,11
,12
Properties:
Property Type Description Restrictions route_id
#/$defs/route_id
- agency_id
#/$defs/agency_id
- route_short_name
#/$defs/route_short_name
- route_long_name
#/$defs/route_long_name
- route_type
#/$defs/route_type
- trips
array
of Any
items. - Required:
- \u201croute_id\u201d
- \u201cagency_id\u201d
- \u201croute_type\u201d
transit_route
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Transit service properties.\",\n \"type\": \"object\",\n \"$defs\": {\n \"agency_id\": {\n \"type\": \"string\",\n \"description\": \"ID for agency.\"\n },\n \"route_id\": {\n \"type\": \"string\",\n \"description\": \"ID for general route.\"\n },\n \"route_short_name\": {\n \"type\": \"string\",\n \"description\": \"Route short name.\"\n },\n \"route_long_name\": {\n \"type\": \"string\",\n \"description\": \"Route long name.\"\n },\n \"route_type\": {\n \"type\": \"integer\",\n \"description\": \"Route type.\",\n \"enum\": [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 11,\n 12\n ],\n \"enumDescriptions\": [\n \"Tram, Streetcar, Light rail. Any light rail or street level system within a metropolitan area.\",\n \"Subway, Metro. Any underground rail system within a metropolitan area.\",\n \"Rail. Used for intercity or long-distance travel.\",\n \"Bus. Used for short- and long-distance bus routes.\",\n \"Ferry. Used for short- and long-distance boat service.\",\n \"Cable tram. Used for street-level rail cars where the cable runs beneath the vehicle, e.g., cable car in San Francisco.\",\n \"Aerial lift, suspended cable car (e.g., gondola lift, aerial tramway). Cable transport where cabins, cars, gondolas or open chairs are suspended by means of one or more cables.\",\n \"Funicular. Any rail system designed for steep inclines.\",\n \"Trolleybus. Electric buses that draw power from overhead wires using poles.\",\n \"Monorail. Railway in which the track consists of a single rail or a beam.\"\n ]\n }\n },\n \"required\": [\n \"route_id\",\n \"agency_id\",\n \"route_type\"\n ],\n \"properties\": {\n \"route_id\": {\n \"$ref\": \"#/$defs/route_id\"\n },\n \"agency_id\": {\n \"$ref\": \"#/$defs/agency_id\"\n },\n \"route_short_name\": {\n \"$ref\": \"#/$defs/route_short_name\"\n },\n \"route_long_name\": {\n \"$ref\": \"#/$defs/route_long_name\"\n },\n \"route_type\": {\n \"$ref\": \"#/$defs/route_type\"\n },\n \"trips\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../transit/transit_trip.json\"\n }\n }\n }\n}\n
"},{"location":"json-schemas/#transittransit_routingjson","title":"transit.transit_routing.json","text":"Type: array
of Any
items.
Property Value anyOf - {\"$ref\": \"#/$defs/detailed_route_stop\"}
- {\"$ref\": \"#/$defs/stop_id_str\"}
- {\"type\": \"integer\"}
Definitions:
Definition Type Description Restrictions stop_id_str
string
ID for stop. detailed_route_stop
object
Stop with detailed attributes. route_stop_attributes
object
Stop charactersitics for a given trip pattern. transit_routing
Example 1 [\n {\n \"1\": {\n \"stop\": true\n }\n },\n {\n \"2\": {\n \"stop\": true\n }\n },\n {\n \"3\": {\n \"stop\": true\n }\n },\n {\n \"4\": {\n \"stop\": true\n }\n },\n {\n \"5\": {\n \"stop\": true,\n \"dwell_sec\": 30\n }\n },\n \"6\"\n]\n
transit_routing
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Transit trip pattern / routing properties.\",\n \"type\": \"array\",\n \"$defs\": {\n \"stop_id_str\": {\n \"type\": \"string\",\n \"description\": \"ID for stop.\",\n \"regex\": \"^[0-9]+$\"\n },\n \"detailed_route_stop\": {\n \"type\": \"object\",\n \"description\": \"Stop with detailed attributes.\",\n \"properties\": {},\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/route_stop_attributes\"\n },\n \"propertyNames\": {\n \"ref\": \"#/$defs/stop_id_str\"\n },\n \"minProperties\": 1,\n \"maxProperties\": 1,\n \"examples\": [\n {\n \"1\": {\n \"stop\": true\n }\n }\n ]\n },\n \"route_stop_attributes\": {\n \"type\": \"object\",\n \"description\": \"Stop charactersitics for a given trip pattern.\",\n \"additionalProperties\": false,\n \"properties\": {\n \"stop\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Whether this is a stop. Defaults to False.\"\n },\n \"dwell_sec\": {\n \"type\": \"integer\",\n \"description\": \"Dwell time in seconds.\"\n },\n \"time_to_next_node_sec\": {\n \"type\": \"integer\",\n \"description\": \"Time to next node in seconds. Defaults to network travel time.\"\n },\n \"board\": {\n \"type\": \"boolean\",\n \"description\": \"Whether passengers can board at this stop.Defaults to True if stop=true. specify only when not default.\"\n },\n \"alight\": {\n \"type\": \"boolean\",\n \"description\": \"Whether passengers can alight at this stop. Defaults to True if stop=true. specify only when not default.\"\n }\n }\n }\n },\n \"minItems\": 2,\n \"items\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/detailed_route_stop\"\n },\n {\n \"$ref\": \"#/$defs/stop_id_str\"\n },\n {\n \"type\": \"integer\"\n }\n ]\n },\n \"examples\": [\n [\n {\n \"1\": {\n \"stop\": true\n }\n },\n {\n \"2\": {\n \"stop\": true\n }\n },\n {\n \"3\": {\n \"stop\": true\n }\n },\n {\n \"4\": {\n \"stop\": true\n }\n },\n {\n \"5\": {\n \"stop\": true,\n \"dwell_sec\": 30\n }\n },\n \"6\"\n ]\n ]\n}\n
"},{"location":"json-schemas/#transittransit_tripjson","title":"transit.transit_trip.json","text":"Type: Object
Additional Information:
description: Transit trip properties.
Definitions:
Definition Type Description Restrictions trip_id
string
ID for Individual trip a transit vehicle takes.. shape_id
string
ID for shape trip is following. service_id
string
ID for service schedule. trip_short_name
string
Route short name, often something like 38X
. trip_headsign
string
Trip Headsign. direction_id
integer
Consistent with GTFS definition defining outbound vs inbound routes. Enumeration: 0
,1
headway_secs_item
object
Headway for each time period. Properties:
Property Type Description Restrictions trip_id
#/$defs/trip_id
- service_id
#/$defs/service_id
- shape_id
#/$defs/shape_id
- route_id
transit_route.json#/$defs/route_id
- trip_headsign
#/$defs/trip_headsign
- trip_short_name
#/$defs/trip_short_name
- direction_id
#/$defs/direction_id
- headway_secs
array
of Any
items. - routing
transit_routing.json
- Required:
- \u201cheadway_secs\u201d
- \u201crouting\u201d
transit_trip
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Transit trip properties.\",\n \"type\": \"object\",\n \"$defs\": {\n \"trip_id\": {\n \"type\": \"string\",\n \"description\": \"ID for Individual trip a transit vehicle takes..\"\n },\n \"shape_id\": {\n \"type\": \"string\",\n \"description\": \"ID for shape trip is following.\"\n },\n \"service_id\": {\n \"type\": \"string\",\n \"description\": \"ID for service schedule.\"\n },\n \"trip_short_name\": {\n \"type\": \"string\",\n \"description\": \"Route short name, often something like `38X`.\"\n },\n \"trip_headsign\": {\n \"type\": \"string\",\n \"description\": \"Trip Headsign.\"\n },\n \"direction_id\": {\n \"type\": \"integer\",\n \"enum\": [\n 0,\n 1\n ],\n \"description\": \"Consistent with GTFS definition defining outbound vs inbound routes.\"\n },\n \"headway_secs_item\": {\n \"type\": \"object\",\n \"examples\": [\n {\n \"('7:00', '9:00')\": 600\n }\n ],\n \"description\": \"Headway for each time period.\"\n }\n },\n \"required\": [\n \"headway_secs\",\n \"routing\"\n ],\n \"properties\": {\n \"trip_id\": {\n \"$ref\": \"#/$defs/trip_id\"\n },\n \"service_id\": {\n \"$ref\": \"#/$defs/service_id\"\n },\n \"shape_id\": {\n \"$ref\": \"#/$defs/shape_id\"\n },\n \"route_id\": {\n \"$ref\": \"transit_route.json#/$defs/route_id\"\n },\n \"trip_headsign\": {\n \"$ref\": \"#/$defs/trip_headsign\"\n },\n \"trip_short_name\": {\n \"$ref\": \"#/$defs/trip_short_name\"\n },\n \"direction_id\": {\n \"$ref\": \"#/$defs/direction_id\"\n },\n \"headway_secs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/headway_secs_item\"\n }\n },\n \"routing\": {\n \"$ref\": \"transit_routing.json\"\n }\n }\n}\n
"},{"location":"json-schemas/#transitselectionselect_route_propertiesjson","title":"transit.selection.select_route_properties.json","text":"Type: Object
Additional Information:
-
description: Selection proeprties for transit routes.
-
additionalProperties: True
Properties:
Property Type Description Restrictions route_short_name
array
of Any
items. - route_long_name
array
of Any
items. - agency_id
array
of Any
items. - route_type
array
of Any
items. - select_route_properties
Example 1 {\n \"route_short_name\": [\n \"1\",\n \"2\",\n \"3\"\n ]\n}\n
select_route_properties
Example 2 {\n \"agency_id\": [\n \"1\"\n ],\n \"route_long_name\": [\n \"Route 1\",\n \"Route 2\",\n \"Route 3\"\n ]\n}\n
select_route_properties
Example 3 {\n \"agency_id\": [\n \"1\"\n ],\n \"route_type\": [\n 0,\n 1,\n 2\n ]\n}\n
select_route_properties
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Selection proeprties for transit routes.\",\n \"type\": \"object\",\n \"additionalProperties\": true,\n \"examples\": [\n {\n \"route_short_name\": [\n \"1\",\n \"2\",\n \"3\"\n ]\n },\n {\n \"agency_id\": [\n \"1\"\n ],\n \"route_long_name\": [\n \"Route 1\",\n \"Route 2\",\n \"Route 3\"\n ]\n },\n {\n \"agency_id\": [\n \"1\"\n ],\n \"route_type\": [\n 0,\n 1,\n 2\n ]\n }\n ],\n \"properties\": {\n \"route_short_name\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_route.json#/$defs/route_short_name\"\n }\n },\n \"route_long_name\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_route.json#/$defs/route_long_name\"\n }\n },\n \"agency_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_route.json#/$defs/agency_id\"\n }\n },\n \"route_type\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_route.json#/$defs/route_type\"\n }\n }\n }\n}\n
"},{"location":"json-schemas/#transitselectionselect_tripsjson","title":"transit.selection.select_trips.json","text":"Type: Object
Additional Information:
-
additionalProperties: False
-
title: Transit Service Facility Selection
Properties:
Property Type Description Restrictions trip_properties
select_trip_properties.json
- route_properties
select_route_properties.json
- timespans
array
of Any
items. - nodes
select_nodes.json
- Transit Service Facility Selection Example 1 {\n \"trip_properties\": {\n \"route_id\": [\n \"1234\"\n ],\n \"bikes_allowed\": \"1\"\n },\n \"route_properties\": {\n \"agency_id\": [\n \"2\"\n ]\n },\n \"timespans\": [\n [\n \"06:00:00\",\n \"09:00:00\"\n ]\n ]\n}\n
Transit Service Facility Selection Example 2 {\n \"trip_properties\": {\n \"route_id\": [\n \"4321\"\n ]\n },\n \"route_properties\": {\n \"agency_id\": [\n \"1\"\n ]\n },\n \"timespans\": [\n [\n \"06:00:00\",\n \"09:00:00\"\n ],\n [\n \"15:00:00\",\n \"18:00:00\"\n ]\n ]\n}\n
Transit Service Facility Selection Example 3 {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ],\n \"require\": \"all\"\n }\n}\n
Transit Service Facility Selection Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"title\": \"Transit Service Facility Selection\",\n \"examples\": [\n {\n \"trip_properties\": {\n \"route_id\": [\n \"1234\"\n ],\n \"bikes_allowed\": \"1\"\n },\n \"route_properties\": {\n \"agency_id\": [\n \"2\"\n ]\n },\n \"timespans\": [\n [\n \"06:00:00\",\n \"09:00:00\"\n ]\n ]\n },\n {\n \"trip_properties\": {\n \"route_id\": [\n \"4321\"\n ]\n },\n \"route_properties\": {\n \"agency_id\": [\n \"1\"\n ]\n },\n \"timespans\": [\n [\n \"06:00:00\",\n \"09:00:00\"\n ],\n [\n \"15:00:00\",\n \"18:00:00\"\n ]\n ]\n },\n {\n \"nodes\": {\n \"model_node_id\": [\n 1,\n 2,\n 3\n ],\n \"require\": \"all\"\n }\n }\n ],\n \"properties\": {\n \"trip_properties\": {\n \"$ref\": \"select_trip_properties.json\"\n },\n \"route_properties\": {\n \"$ref\": \"select_route_properties.json\"\n },\n \"timespans\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"../../defs/timespan.json\"\n },\n \"minItems\": 1\n },\n \"nodes\": {\n \"$ref\": \"select_nodes.json\"\n }\n }\n}\n
"},{"location":"json-schemas/#transitselectionselect_trip_propertiesjson","title":"transit.selection.select_trip_properties.json","text":"Type: Object
Additional Information:
-
description: Selection properties for transit trips.
-
additionalProperties: True
Properties:
Property Type Description Restrictions trip_id
array
of Any
items. - shape_id
array
of Any
items. - direction_id
../transit_trip.json#/$defs/direction_id
- service_id
array
of Any
items. - route_id
array
of Any
items. - trip_short_name
array
of Any
items. - select_trip_properties
Example 1 {\n \"trip_id\": [\n \"1\",\n \"2\"\n ],\n \"direction_id\": 0\n}\n
select_trip_properties
Example 2 {\n \"shape_id\": [\n \"1\",\n \"2\"\n ]\n}\n
select_trip_properties
Example 3 {\n \"service_id\": [\n \"1\",\n \"2\"\n ],\n \"route_id\": [\n \"1\",\n \"2\"\n ]\n}\n
select_trip_properties
Example 4 {\n \"trip_short_name\": [\n \"1\",\n \"2\"\n ]\n}\n
select_trip_properties
Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"Selection properties for transit trips.\",\n \"type\": \"object\",\n \"additionalProperties\": true,\n \"examples\": [\n {\n \"trip_id\": [\n \"1\",\n \"2\"\n ],\n \"direction_id\": 0\n },\n {\n \"shape_id\": [\n \"1\",\n \"2\"\n ]\n },\n {\n \"service_id\": [\n \"1\",\n \"2\"\n ],\n \"route_id\": [\n \"1\",\n \"2\"\n ]\n },\n {\n \"trip_short_name\": [\n \"1\",\n \"2\"\n ]\n }\n ],\n \"properties\": {\n \"trip_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_trip.json#/$defs/trip_id\"\n }\n },\n \"shape_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_trip.json#/$defs/shape_id\"\n }\n },\n \"direction_id\": {\n \"$ref\": \"../transit_trip.json#/$defs/direction_id\"\n },\n \"service_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_trip.json#/$defs/service_id\"\n }\n },\n \"route_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_route.json#/$defs/route_id\"\n }\n },\n \"trip_short_name\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_trip.json#/$defs/trip_short_name\"\n }\n }\n }\n}\n
"},{"location":"json-schemas/#transitselectionselect_nodesjson","title":"transit.selection.select_nodes.json","text":"Type: Object
Additional Information:
-
description: requirements for describing multiple transit nodes of a project card (e.g. to delete).
-
additionalProperties: False
-
title: Transit network nodes
Properties:
Property Type Description Restrictions stop_id
array
of Any
items. - model_node_id
array
of Any
items. - require
string
- Enumeration: any
,all
One Of:
- {\u201crequired\u201d: [\u201cstop_id\u201d]}
- {\u201crequired\u201d: [\u201cmodel_node_id\u201d]}
Transit network nodes Example 1 {\n \"stop_id\": [\n \"stop1\",\n \"stop2\"\n ],\n \"require\": \"any\"\n}\n
Transit network nodes Example 2 {\n \"model_node_id\": [\n 1,\n 2\n ],\n \"require\": \"all\"\n}\n
Transit network nodes Contents {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"requirements for describing multiple transit nodes of a project card (e.g. to delete).\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"title\": \"Transit network nodes\",\n \"oneOf\": [\n {\n \"required\": [\n \"stop_id\"\n ]\n },\n {\n \"required\": [\n \"model_node_id\"\n ]\n }\n ],\n \"examples\": [\n {\n \"stop_id\": [\n \"stop1\",\n \"stop2\"\n ],\n \"require\": \"any\"\n },\n {\n \"model_node_id\": [\n 1,\n 2\n ],\n \"require\": \"all\"\n }\n ],\n \"properties\": {\n \"stop_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../transit_stop.json#/$defs/stop_id\"\n }\n },\n \"model_node_id\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"$ref\": \"../../roadway/roadway_node.json#/$defs/model_node_id\"\n }\n },\n \"require\": {\n \"type\": \"string\",\n \"enum\": [\n \"any\",\n \"all\"\n ]\n }\n }\n}\n
"}]}
\ No newline at end of file