fasttrips.Stop
- class fasttrips.Stop(input_archive, output_dir, gtfs, today)[source]
Stop class.
One instance represents all of the Stops as well as their transfer links.
Stores stop information in
Stop.stops_df, an instance ofpandas.DataFrame,- __init__(input_archive, output_dir, gtfs, today)[source]
Constructor. Reads the gtfs data from the transitfeed schedule, and the additional fast-trips stops data from the input files in input_archive.
Methods
__init__(input_archive, output_dir, gtfs, today)Constructor.
add_daps_tazs_to_stops(dap_df, ...)Drive access points (PNR lots, KNR lots, etc) and TAZs are like stops.
add_numeric_stop_id(input_df, id_colname, ...)Passing a
pandas.DataFramewith a stop ID column called id_colname, adds the numeric stop id as a column named numeric_newcolname and returns it.add_numeric_stop_zone_id(input_df, ...[, ...])Passing a
pandas.DataFramewith a stop zone ID column called id_colname, adds the numeric stop zone id as a column named numeric_newcolname and returns it.add_stop_id_for_numeric_id(input_df, ...)Passing a
pandas.DataFramewith a stop ID num column called numeric_id, adds the string stop id as a column named id_colname and returns it.add_stop_lat_lon(input_df, id_colname, ...)Passing a
pandas.DataFramewith a stop ID column called id_colname, adds the stop latitude and longitude as columns named new_lat_colname and new_lon_colname and returns it.add_stop_zone_id(input_df, id_colname, ...)Passing a
pandas.DataFramewith a stop ID column called id_colname, adds the stop zone id as a column named zone_colname and returns it.add_trips(stop_times_df)Add myself to the given trip.
get_transfers(stop_id, xfer_from)get_trips_arriving_within_time(stop_id, ...)Return list of [(trip_id, sequence, arrival_time)] where the arrival time is before latest_arrival but within time_window.
get_trips_departing_within_time(stop_id, ...)Return list of [(trip_id, sequence, departure_time)] where the departure time is after earliest_departure but within time_window.
is_transfer(stop_id, xfer_from)Returns true iff this is a transfer stop; e.g.
stop_min_max_lat_lon()Returns (min_stop_lat, max_stop_lat,
Attributes
INPUT_STOPS_FILEFile with fasttrips stop information (this extends the gtfs stops file).
OUTPUT_STOP_ID_NUM_FILEFile with stop ID, stop ID number correspondence
STOPS_COLUMN_BIKE_PARKINGfasttrips Stops column name: Bike Parking
STOPS_COLUMN_BIKE_SHARE_STATIONfasttrips Stops column name: Bike Share Station
STOPS_COLUMN_LEVELfasttrips Stops column name: Level
STOPS_COLUMN_LIGHTINGfasttrips Stops column name: Lighting
STOPS_COLUMN_OFF_BOARD_PAYMENTfasttrips Stops column name: Off-Board Payment
STOPS_COLUMN_PLATFORM_HEIGHTfasttrips Stops column name: Platform Height
STOPS_COLUMN_SEATINGfasttrips Stops column name: Seating
STOPS_COLUMN_SHELTERfasttrips Stops column name: Shelter
STOPS_COLUMN_STOP_IDgtfs Stops column name: Unique identifier (object)
STOPS_COLUMN_STOP_ID_NUMfasttrips Stops column name: Stop Numerical Identifier.
STOPS_COLUMN_STOP_LATITUDEgtfs Stops column name: Latitude
STOPS_COLUMN_STOP_LONGITUDEgtfs Stops column name: Longitude
STOPS_COLUMN_STOP_NAMEgtfs Stops column name: Stop name (string)
STOPS_COLUMN_ZONE_IDgtfs Stops column name: Zone ID
STOPS_COLUMN_ZONE_ID_NUMfasttrips Stops column name: Zone Numerical Identifier.
max_stop_id_numNote the max stop ID num in
Stop.max_stop_id_num.trip_times_dfTrips table.