Skip to content

Commit f5a263b

Browse files
committed
add caltrans_district to ca stops
1 parent 1ba0f54 commit f5a263b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

open_data/create_stops_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def finalize_export_df(df: gpd.GeoDataFrame) -> gpd.GeoDataFrame:
9999
'n_routes', 'route_ids_served', 'route_types_served',
100100
'n_arrivals', 'n_hours_in_service',
101101
]
102-
agency_ids = ['base64_url']
102+
agency_ids = ['base64_url', 'caltrans_district']
103103

104104
col_order = route_cols + stop_cols + agency_ids + ['geometry']
105105

open_data/open_data_utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,23 @@ def standardize_operator_info_for_exports(
3131
f"{SCHED_GCS}{CROSSWALK_FILE}_{date}.parquet",
3232
columns = [
3333
"schedule_gtfs_dataset_key", "name", "base64_url",
34-
"organization_source_record_id", "organization_name"
34+
"organization_source_record_id", "organization_name",
35+
"caltrans_district",
3536
],
3637
filters = [[("schedule_gtfs_dataset_key", "in", public_feeds)]]
3738
)
3839

40+
# Checked whether we need a left merge to keep stops outside of CA
41+
# that may not have caltrans_district
42+
# and inner merge is fine. All operators are assigned a caltrans_district
43+
# so Amtrak / FlixBus stops have values populated
3944
df2 = pd.merge(
4045
df,
4146
crosswalk,
4247
on = "schedule_gtfs_dataset_key",
4348
how = "inner"
4449
)
45-
50+
4651
return df2
4752

4853

0 commit comments

Comments
 (0)