Place for sharing quick reports, and works in progress
Mostly located in update_vars.py.
HQ_TRANSIT_THRESHOLD
, MS_TRANSIT_THRESHOLD
: Statutory definition, see README.mdAM_PEAK
, PM_PEAK
: Reflect most common MPO methodologies, not defined in statuteHQTA_SEGMENT_LENGTH
, SEGMENT_BUFFER_METERS
: Our definitions for splitting corridors into analysis segments and matching them to stopsCORRIDOR_BUFFER_METERS
: Statutory definitionSHARED_STOP_THRESHOLD
: Our threshold for finding similar routes (routes sharing at least this many stops with another in the same direction). Reflects the 96th percentile.Defined via Makefile
create_aggregate_stop_frequencies.py
This script finds similar (collinear) routes.
Get frequencies at each stop for defined peak periods, with one version only looking at the single most frequent routes per stop and another version looking at all routes per stop.
Find stops in the multi-route version that qualify at a higher threshold than they do in the single-route version. These are the stops (and thus routes and feeds) that we want to check for collinearity.
Then… evaluate which route_directions can be aggregated at each remaining stop. From the full list of route_directions (sorted by frequency) serving the stop, use list(itertools.combinations(this_stop_route_dirs, 2))
to get each unique pair of route_directions. Check each of those unique pairs to see if it meets the SHARED_STOP_THRESHOLD
. If they all do, keep all stop_times entries for that stop, different route_directions can be aggregated together at that stop. If any do not, remove the least frequent route_direction and try again, until a subset passes (only keep stop_times for that subset) or until all are eliminated. Currently implemented recursively as below:
attempting ['103_1', '101_1', '102_1', '104_1']... subsetting...
attempting ['103_1', '101_1', '102_1']... subsetting...
attempting ['103_1', '101_1']... matched!
attempting ['103_1', '101_0', '101_1', '103_0']... subsetting...
attempting ['103_1', '101_0', '101_1']... subsetting...
attempting ['103_1', '101_0']... subsetting...
exhausted!
SHARED_STOP_THRESHOLD
after aggregation (by ensuring at least one route_dir at each stop has >= SHARED_STOP_THRESHOLD
frequent stops). Exclude stops that don’t meet this criteria.AC Transit 45 Opposite directions share a same-direction loop. Solved by preventing the same route from being compared with itself in the opposite direction.
SDMTS 944/945 Shared frequent stops are few, and these routes are isolated. Solved by once again applying the SHARED_STOP_THRESHOLD
after aggregation (by ensuring at least one route_dir at each stop has >= SHARED_STOP_THRESHOLD
frequent stops). Complex typology including a loop route, each pair of [944, 945, 945A(946)] has >= threshold… but not actually in the same spots!
Export stop-level frequencies that are a composite of single-route results, and multi-route results passing the collinearity evaluation. These will be the stop-level frequencies used in subsequent steps.
sjoin_stops_to_segments.py
SEGMENT_BUFFER_METERS
) to the extent possible.