polaris.network.transit.transit_elements.Trip

polaris.network.transit.transit_elements.Trip#

class polaris.network.transit.transit_elements.Trip#

Bases: BasicPTElement

Transit trips read from trips.txt

GTFS class members:

  • trip (str): Trip ID as read from the GTFS feed

  • route (str): Route ID as read from the GTFS feed

  • service_id (str): Service ID as read from the GTFS feed

  • trip_headsign (str): Trip headsign as read from the GTFS feed

  • trip_short_name (str): Trip short name as read from the GTFS feed

  • direction_id (int): Direction ID as read from the GTFS feed

  • block_id (int): Block ID as read from the GTFS feed

  • bikes_allowed (int): Bikes allowed flag as read from the GTFS feed

  • wheelchair_accessible (int): Wheelchair accessibility flag as read from the GTFS feed

  • shape_id (str): Shape ID as read from the GTFS feed

Processing class members:

  • trip_id (int): Unique trip_id as it will go into the database

  • route_id (int): Unique Route ID as will be available in the routes table

  • pattern_id (int): Unique Pattern ID for this route/stop-pattern as it will go into the database

  • pattern_hash (str): Pattern ID derived from stops for this route/stop-pattern

  • arrivals (List[int]): Sequence of arrival at stops for this trip

  • departures (List[int]): Sequence of departures from stops for this trip

  • stops (List[Stop]): Sequence of stops for this trip

  • shape (LineString): Shape for this trip. Directly from shapes.txt or rebuilt from sequence of stops

__init__()#

Methods

__init__()

from_row(data)

get_trip_id()

save_to_database(conn[, commit])

Saves Transit trip to the database

__init__()#
save_to_database(conn: Connection, commit=True) None#

Saves Transit trip to the database

get_trip_id()#