aequilibrae.transit.lib_gtfs#

Classes

GTFSRouteSystemBuilder(network, ...[, day, ...])

class aequilibrae.transit.lib_gtfs.GTFSRouteSystemBuilder(network, agency_identifier, file_path, day='', description='', capacities=None, pces=None)[source]#

Build the graph for links for a certain mode while splitting the closest links at stops’ projection

Arguments:

mode_id (int): Mode ID for which we will build the graph for

dates_available() list[source]#

Returns a list of all dates available for this feed.

Returns:

feed dates (list): list of all dates available for this feed

doWork()[source]#

Alias for execute_import

execute_import()[source]#
load_date(service_date: str) None[source]#

Loads the transit services available for service_date

Arguments:

service_date (str): Service data contained in this field to be imported (e.g. ‘2019-10-04’)

map_match(route_types=[3]) None[source]#

Performs map-matching for all routes of one or more types.

Defaults to map-matching Bus routes (type 3) only.

For a reference of route types, see the inputs for route_type here.

Arguments:

route_types (List[int] or Tuple[int]): Default is [3], for bus only

save_to_disk()[source]#

Saves all transit elements built in memory to disk

set_agency_identifier(agency_id: str) None[source]#

Adds agency ID to this GTFS for use on import.

Arguments:

agency_id (str): ID for the agency this feed refers to (e.g. ‘CTA’)

set_allow_map_match(allow=True)[source]#

Changes behavior for finding transit-link shapes. Defaults to True.

Arguments:

allow (bool Optional): If True, allows uses map-matching in search of precise transit_link shapes. If False, sets transit_link shapes equal to straight lines between stops. In the presence of GTFS raw shapes it has no effect.

set_capacities(capacities: dict)[source]#

Sets default capacities for modes/vehicles.

Arguments:

capacities (dict): Dictionary with GTFS types as keys, each with a list of 3 items for values for capacities: seated and total i.e. -> “{0: [150, 300],…}”

set_date(service_date: str) None[source]#

Sets the date for import without doing any of data processing, which is left for the importer

set_description(description: str) None[source]#

Adds description to be added to the imported layers metadata

Arguments:

description (str): Description for this feed (e.g. ‘CTA2019 fixed by John Doe after strong coffee’)

set_feed(feed_path: str) None[source]#

Sets GTFS feed source to be used.

Arguments:

file_path (str): Full path to the GTFS feed (e.g. ‘D:/project/my_gtfs_feed.zip’)

set_maximum_speeds(max_speeds: DataFrame)[source]#

Sets the maximum speeds to be enforced at segments.

Arguments:

max_speeds (pd.DataFrame): Requires 4 fields: mode, min_distance, max_distance, speed. Modes not covered in the data will not be touched and distance brackets not covered will receive the maximum speed, with a warning

set_pces(pces: dict)[source]#

Sets default passenger car equivalent (PCE) factor for each GTFS mode.

Arguments:

pces (dict): Dictionary with GTFS types as keys and the corresponding PCE value i.e. -> “{0: 2.0,…}”

signal = <aequilibrae.utils.python_signal.PythonSignal object>#

Container for GTFS feeds providing data retrieval for the importer