Skip to content

transitlos.stop_table

One row per real stop_id (at its own location) with ITS routes and mode, plus the scores of the station it belongs to.

The scoring works per parent station (a group of stops: best_subset_stop_scores), but the map must show every stop where it really is: a rail platform and the bus stops around it are separate points, each with its own mode (emoji), its own route list (colours included) and, in the popup, the station-level data. stop_table_from_feed builds that table from the same Feed the scoring used:

stop_id, stop_name, stop_lat, stop_lon, parent_station,
mode_category        mode OF THIS STOP: rail > tram > bus among the routes that serve this stop_id,
all_routes           this stop's route labels (comma separated, rail first),
route_info           "label~#color~#textcolor~mode~kept(1/0);..." for the same routes (colours exactly as the route lines draw them),
+ the station's score columns (`stop_score`, `headway_minutes`, ... `scoring_mode`) joined on `parent_station`.

stop_table_from_feed(feed, stations=None)

The stop-level table of feed (see module docstring); stations = the scored station table (joined on parent_station).

Parameters:

Name Type Description Default
feed

A loaded pyGTFSHandler Feed.

required
stations Optional[DataFrame]

Optional scored station table.

None

Returns:

Type Description
DataFrame

One row per stop.