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 of pandas.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.DataFrame with 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.DataFrame with 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.DataFrame with 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.DataFrame with 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.DataFrame with 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_FILE

File with fasttrips stop information (this extends the gtfs stops file).

OUTPUT_STOP_ID_NUM_FILE

File with stop ID, stop ID number correspondence

STOPS_COLUMN_BIKE_PARKING

fasttrips Stops column name: Bike Parking

STOPS_COLUMN_BIKE_SHARE_STATION

fasttrips Stops column name: Bike Share Station

STOPS_COLUMN_LEVEL

fasttrips Stops column name: Level

STOPS_COLUMN_LIGHTING

fasttrips Stops column name: Lighting

STOPS_COLUMN_OFF_BOARD_PAYMENT

fasttrips Stops column name: Off-Board Payment

STOPS_COLUMN_PLATFORM_HEIGHT

fasttrips Stops column name: Platform Height

STOPS_COLUMN_SEATING

fasttrips Stops column name: Seating

STOPS_COLUMN_SHELTER

fasttrips Stops column name: Shelter

STOPS_COLUMN_STOP_ID

gtfs Stops column name: Unique identifier (object)

STOPS_COLUMN_STOP_ID_NUM

fasttrips Stops column name: Stop Numerical Identifier.

STOPS_COLUMN_STOP_LATITUDE

gtfs Stops column name: Latitude

STOPS_COLUMN_STOP_LONGITUDE

gtfs Stops column name: Longitude

STOPS_COLUMN_STOP_NAME

gtfs Stops column name: Stop name (string)

STOPS_COLUMN_ZONE_ID

gtfs Stops column name: Zone ID

STOPS_COLUMN_ZONE_ID_NUM

fasttrips Stops column name: Zone Numerical Identifier.

max_stop_id_num

Note the max stop ID num in Stop.max_stop_id_num.

trip_times_df

Trips table.