aequilibrae.transit.transit_elements package#
Submodules#
aequilibrae.transit.transit_elements.agency module#
- class aequilibrae.transit.transit_elements.agency.Agency[source]#
Bases:
BasicPTElement
Transit Agency to load into the database
agency_id (
int
): ID for the transit agencyagency (
str
): Name of the transit agencyfeed_date (
str
): Date for the transit feed using in the importservice_date (
str
): Date for the route services being importeddescription (
str
): Description of the feed
aequilibrae.transit.transit_elements.basic_element module#
aequilibrae.transit.transit_elements.fare module#
- class aequilibrae.transit.transit_elements.fare.Fare(agency_id: int)[source]#
Bases:
object
Transit Fare
fare_id (
int
): ID of the fare as in the network modelfare (
str
): ID of the fare as in GTFSagency (
str
): Corresponding agency as inputed during importagency_id (
int
): ID of the corresponding agency as in the network modelprice (
int
): As in GTFScurrency (
str
): As in GTFSpayment_method (
int
): As in GTFStransfer (
int
): As in GTFStransfer_duration (
int
): As in GTFS
aequilibrae.transit.transit_elements.fare_rule module#
- class aequilibrae.transit.transit_elements.fare_rule.FareRule[source]#
Bases:
object
Transit Fare
fare_id (
int
): Fare Id to which this rule appliesfare (
str
): Name of the fare ruleroute (
str
): Route ID as in GTFS to which this fare rule appliesroute_id (
int
): Route ID as in network model to which this fare rule appliesorigin (
int
): Transit zone ID for origindestination (
int
): Transit zone ID for destinationcontains (
str
): As in GTFSagency_id (
int
): Agency ID as in the network modelorigin_id (
int
): Origin zone ID as in the network modeldestination_id (
int
): Destination Zone ID as in the network model
aequilibrae.transit.transit_elements.link module#
- class aequilibrae.transit.transit_elements.link.Link(srid)[source]#
Bases:
object
Transit link element.
transit_link (
int
): ID of the transit link (updated when inserted in the database)from_stop (
str
): Origin of the transit connectionto_stop (
str
): Destination of the transit connectionpair (
str
): Identifier of the stop pair as FROM_ID##TO_ID. For identification onlygeo (
LineString
): Geometry of the transit link as direct connection between stopslength (
float
): Link length measured directly from the geometry objecttype (
int
): Route type (mode) for this transit linksrid (
int
): srid of our working database
aequilibrae.transit.transit_elements.mode_correspondence module#
aequilibrae.transit.transit_elements.pattern module#
- class aequilibrae.transit.transit_elements.pattern.Pattern(route_id, gtfs_feed)[source]#
Bases:
BasicPTElement
Represents a stop pattern for a particular route, as defined in GTFS.
- save_to_database(conn: Connection, commit=True) None [source]#
Saves the pattern to the routes table
- map_match()[source]#
Map matches the route into the network, considering its appropriate shape.
Part of the map-matching process is to find the network links corresponding the pattern’s raw shape, so that method will be called in case it has not been called before.
The basic algorithm behind the map-matching algorithm is described in https://doi.org/10.3141%2F2646-08
In a nutshell, we compute the shortest path between the nodes corresponding to the links to which stops were geographically matched, for each pair of identified links.
We do not consider links that are in perfect sequence, as we found that it introduces severe issues when stops are close to intersections without clear upsides.
When issues are found, we remove the stops in the immediate vicinity of the issue and attempt new path finding. The First and last stops/corresponding links are always kept.
If an error was found, (record for it will show in the log), it is stored within the object.
aequilibrae.transit.transit_elements.route module#
- class aequilibrae.transit.transit_elements.route.Route(agency_id)[source]#
Bases:
BasicPTElement
Transit route element to feed into Transit_routes
route_id (
str
): ID of this route, starting with the agency prefix IDroute_short_name (
str
): Short name as found in the GTFS feedroute_long_name (
str
): Long name as found in the GTFS feedroute_desc (
str
): Route description as found in the GTFS feedroute_type (
int
): Route type (mode) for this transit linkroute_url (
str
): Route URL as found in the GTFS feedroute_color (
str
): Route color for mapping as found in the GTFS feedroute_text_color (
str
): Route color (text) for mapping as found in the GTFS feedroute_sort_order (
int
): Route rendering order as found in the GTFS feedagency_id (
str
): Agency IDseated_capacity (
float
): Vehicle seated capacity for this routetotal_capacity (
float
): Total vehicle capacity for this route
- property data#
aequilibrae.transit.transit_elements.service module#
- class aequilibrae.transit.transit_elements.service.Service[source]#
Bases:
object
Transit service built with data from calendar.txt and calendar_dates.txt from GTFS
service_id (
str
):monday (
int
): Flag if the route runs on mondays (1 for True, 0 for False)tuesday (
int
): Flag if the route runs on tuesdays (1 for True, 0 for False)wednesday (
int
): Flag if the route runs on wednesdays (1 for True, 0 for False)thursday (
int
): Flag if the route runs on thursdays (1 for True, 0 for False)friday (
int
): Flag if the route runs on fridays (1 for True, 0 for False)saturday (
int
): Flag if the route runs on saturdays (1 for True, 0 for False)sunday (
int
): Flag if the route runs on sundays (1 for True, 0 for False)start_date (
str
): Start date for this serviceend_date (
str
): End date for this servicedates (
List[str]
): List of all dates for which this service is active between its start and end dates
aequilibrae.transit.transit_elements.stop module#
- class aequilibrae.transit.transit_elements.stop.Stop(agency_id: int, record: tuple, headers: list)[source]#
Bases:
BasicPTElement
Transit stop as read from the GTFS feed
- property data: list#
aequilibrae.transit.transit_elements.trip module#
- class aequilibrae.transit.transit_elements.trip.Trip[source]#
Bases:
BasicPTElement
Transit trips read from trips.txt
trip (
str
): Trip ID as read from the GTFS feedroute (
str
): Route ID as read from the GTFS feedservice_id (
str
): Service ID as read from the GTFS feedtrip_headsign (
str
): Trip headsign as read from the GTFS feedtrip_short_name (
str
): Trip short name as read from the GTFS feeddirection_id (
int
): Direction ID as read from the GTFS feedblock_id (
int
): Block ID as read from the GTFS feedbikes_allowed (
int
): Bikes allowed flag as read from the GTFS feedwheelchair_accessible (
int
): Wheelchair accessibility flag as read from the GTFS feedshape_id (
str
): Shape ID as read from the GTFS feedtrip_id (
int
): Unique trip_id as it will go into the databaseroute_id (
int
): Unique Route ID as will be available in the routes tablepattern_id (
int
): Unique Pattern ID for this route/stop-pattern as it will go into the databasepattern_hash (
str
): Pattern ID derived from stops for this route/stop-patternarrivals (
List[int]
): Sequence of arrival at stops for this tripdepartures (
List[int]
): Sequence of departures from stops for this tripstops (
List[Stop]
): Sequence of stops for this tripshape (
LineString
): Shape for this trip. Directly from shapes.txt or rebuilt from sequence of stops