aequilibrae.transit.lib_gtfs.GTFSRouteSystemBuilder#
- class aequilibrae.transit.lib_gtfs.GTFSRouteSystemBuilder(network, agency_identifier, file_path, day='', description='', capacities=None, pces=None)[source]#
- __init__(network, agency_identifier, file_path, day='', description='', capacities=None, pces=None)[source]#
Instantiates a transit class for the network
- Arguments:
local network (
Network
): Supply model to which this GTFS will be importedagency_identifier (
str
): ID for the agency this feed refers to (e.g. ‘CTA’)file_path (
str
): Full path to the GTFS feed (e.g. ‘D:/project/my_gtfs_feed.zip’)day (
str
, Optional): Service data contained in this field to be imported (e.g. ‘2019-10-04’)description (
str
, Optional): Description for this feed (e.g. ‘CTA19 fixed by John after coffee’)
Methods
__init__
(network, agency_identifier, file_path)Instantiates a transit class for the network
Build the graph for links for a certain mode while splitting the closest links at stops' projection
Returns a list of all dates available for this feed.
doWork
()Alias for execute_import
load_date
(service_date)Loads the transit services available for service_date
map_match
([route_types])Performs map-matching for all routes of one or more types.
Saves all transit elements built in memory to disk
set_agency_identifier
(agency_id)Adds agency ID to this GTFS for use on import.
set_allow_map_match
([allow])Changes behavior for finding transit-link shapes.
set_capacities
(capacities)Sets default capacities for modes/vehicles.
set_date
(service_date)Sets the date for import without doing any of data processing, which is left for the importer
set_description
(description)Adds description to be added to the imported layers metadata
set_feed
(feed_path)Sets GTFS feed source to be used.
set_maximum_speeds
(max_speeds)Sets the maximum speeds to be enforced at segments.
set_pces
(pces)Sets default passenger car equivalent (PCE) factor for each GTFS mode.
Attributes
Container for GTFS feeds providing data retrieval for the importer
- builds_link_graphs_with_broken_stops()[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
- 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]
orTuple[int]
): Default is [3], for bus only
- 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): IfTrue
, allows uses map-matching in search of precise transit_link shapes. IfFalse
, 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