aequilibrae.project.Zone#

class aequilibrae.project.Zone(dataset: dict, zoning)[source]#

Single zone object that can be queried and manipulated in memory

__init__(dataset: dict, zoning)[source]#

Methods

__init__(dataset, zoning)

add_centroid(point[, robust])

Adds a centroid to the network file

connect_db()

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

delete()[source]#

Removes the zone from the database

save()[source]#

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 zone

robust (Bool, Optional): Moves the centroid location around to avoid node conflict. Defaults to True.

connect_mode(mode_id: str, link_types='', connectors=1, conn: Connection | None = None) 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 computing running the KMeans2 clustering algorithm from SciPy and selecting the nodes closest to each cluster centroid.

When there are no node candidates inside the zone, the search area is progressively expanded until at least one candidate is found.

If fewer candidates than required connectors are found, all candidates are connected.

Arguments:

mode_id (str): Mode ID we are trying to connect

link_types (str, Optional): String with all the link type IDs that can be considered. eg: yCdR. Defaults to ALL link types

connectors (int, Optional): Number of connectors to add. Defaults to 1

disconnect_mode(mode_id: str) None[source]#

Removes centroid connectors for the desired mode from the network file

Arguments:

mode_id (str): Mode ID we are trying to disconnect from this zone

connect_db()#