aequilibrae.project.Zone#
- class aequilibrae.project.Zone(dataset: dict, zoning)[source]#
Single zone object that can be queried and manipulated in memory
Methods
__init__
(dataset, zoning)add_centroid
(point[, robust])Adds a centroid to the network file
connect_mode
(mode_id[, link_types, ...])Adds centroid connectors for the desired mode to the network file
delete
()Removes the zone from the database
disconnect_mode
(mode_id)Removes centroid connectors for the desired mode from the network file
save
()Saves/Updates the zone data to the database
- add_centroid(point: Point, robust=True) None [source]#
Adds a centroid to the network file
- Arguments:
point (
Point
): Shapely Point corresponding to the desired centroid position. If None, uses the geometric center of the zonerobust (
Bool
, Optional): Moves the centroid location around to avoid node conflict. Defaults toTrue
.
- connect_db()#
- connect_mode(mode_id: str, link_types='', connectors=1, conn: Connection | None = None, limit_to_zone=True) None [source]#
Adds centroid connectors for the desired mode to the network file
Centroid connectors are created by connecting the zone centroid to one or more nodes selected from all those that satisfy the mode and link_types criteria and are inside the zone.
The selection of the nodes that will be connected is done simply by searching for the node closest to the zone centroid, or the N closest nodes to the centroid.
If fewer candidates than required connectors are found, all candidates are connected.
- Arguments:
mode_id (
str
): Mode ID we are trying to connectlink_types (
str
, Optional): String with all the link type IDs that can be considered. eg: yCdR. Defaults to ALL link typesconnectors (
int
, Optional): Number of connectors to add. Defaults to 1conn (
sqlite3.Connection
, Optional): Connection to the database.limit_to_zone (
bool
): Limits the search for nodes inside the zone. Defaults toTrue
.