Skip to content

Commit

Permalink
Merge pull request #1356 from cal-itp/jan-open-data
Browse files Browse the repository at this point in the history
Jan + Feb open data (will do ArcGIS steps separately but wanted to get this merged)
  • Loading branch information
edasmalchi authored Feb 18, 2025
2 parents a78a1fe + f038888 commit 8f8e962
Show file tree
Hide file tree
Showing 193 changed files with 5,117 additions and 2,368 deletions.
1 change: 1 addition & 0 deletions _shared_utils/shared_utils/gtfs_analytics_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ speedmap_segments:
segments_file: "segment_options/speedmap_segments"
shape_stop_single_segment: "rollup_singleday/speeds_shape_speedmap_segments"
shape_stop_single_segment_detail: "rollup_singleday/speeds_shape_speedmap_segments_detail"
# excluded_shapes_by_time_of_day: "rollup_singleday/excluded_shapes_by_time_of_day"
route_dir_single_segment: "rollup_singleday/speeds_route_dir_speedmap_segments"
route_dir_multi_segment: "rollup_multiday/speeds_route_dir_speedmap_segments"
min_trip_minutes: ${speed_vars.time_min_cutoff}
Expand Down
2 changes: 2 additions & 0 deletions _shared_utils/shared_utils/rt_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"oct2024g": "2024-10-21", # additional one-off to capture Amtrak in HQTA
"nov2024": "2024-11-13",
"dec2024": "2024-12-11",
"jan2025": "2025-01-15",
"feb2025": "2025-02-12",
}

y2023_dates = [
Expand Down
108 changes: 56 additions & 52 deletions ca_transit_speed_maps/01_new_speedmaps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"id": "23f682c8-187e-4586-a0b2-00dd7569e0c4",
"execution_count": 3,
"id": "82d7b8ac-3897-4604-9be4-37bd480577e7",
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"speedmap_segs, this_shn = speedmap_utils.read_segments_shn(organization_source_record_id=organization_source_record_id)"
"speedmap_segs, this_shn = speedmap_utils.read_segments_shn(organization_source_record_id=organization_source_record_id)\n",
"org_shapes = speedmap_utils.read_shapes(speedmap_segs)"
]
},
{
Expand Down Expand Up @@ -70,7 +71,9 @@
{
"cell_type": "markdown",
"id": "d0b9c978-e6a6-4646-a2c0-e3a603f1dfc3",
"metadata": {},
"metadata": {
"tags": []
},
"source": [
"# {organization_name}"
]
Expand All @@ -89,7 +92,8 @@
"* Route segments are arrow-shaped to indicate direction of travel. Thicker segments indicate more frequent transit routes.\n",
"* State Highway Network routes are outlined in gray.\n",
"* Hover over, a segment with your mouse to see the exact speed, route name, and transit service frequency in that segment. \n",
" * Higher-frequency routes (3+ trips per hour) are especially important, since those slowdowns correspond to more vehicles, and riders, delayed in traffic."
" * Higher-frequency routes (3+ trips per hour) are especially important, since those slowdowns correspond to more vehicles, and riders, delayed in traffic.\n",
"* Route segments with no data are now shown as thin, dark gray or black segments. These may be due to the route not running at that time of day, or a data availability or processing issue."
]
},
{
Expand All @@ -104,7 +108,7 @@
},
{
"cell_type": "markdown",
"id": "6e2aa3d4-acef-4e64-9fa6-07a95ae5112b",
"id": "8b335f1d-5d61-4356-8258-68eb0b069989",
"metadata": {},
"source": [
"### 20th Percentile Speeds by Segment"
Expand All @@ -113,19 +117,19 @@
{
"cell_type": "code",
"execution_count": null,
"id": "0a6d0609-3517-46be-a08f-0d04129a62ff",
"id": "0003df13-f7d7-4d70-bd8a-91f0cc4e95c3",
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, analysis_date=ANALYSIS_DATE,\n",
" time_of_day='AM Peak', map_type='new_speedmap')"
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, org_shapes=org_shapes,\n",
" analysis_date=ANALYSIS_DATE, time_of_day='AM Peak', map_type='new_speedmap')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "22dea4bc-91c3-43b9-a540-d9b52237f51f",
"id": "364e6af4-da42-44d6-a252-9b4039e3f590",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -135,7 +139,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "7019c47a-0620-458a-a45a-005f288ee805",
"id": "4b7d4db9-6c2c-4151-93d7-c92c512a221d",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -144,7 +148,7 @@
},
{
"cell_type": "markdown",
"id": "02bafcad-7e1a-43f7-86ba-9b3c56135a62",
"id": "9dbefb68-c2fa-47b9-84ab-9c5e86315f56",
"metadata": {},
"source": [
"### Variation in Speeds by Segment\n",
Expand All @@ -156,19 +160,19 @@
{
"cell_type": "code",
"execution_count": null,
"id": "82a148cd-1561-4c88-bccf-f552307c2a3d",
"id": "f942bbf6-16f4-402b-a7e4-cec9b95e5243",
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, analysis_date=ANALYSIS_DATE,\n",
" time_of_day='AM Peak', map_type='new_speed_variation')"
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, org_shapes=org_shapes,\n",
" analysis_date=ANALYSIS_DATE, time_of_day='AM Peak', map_type='new_speed_variation')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "adf4b569-0029-4295-bc14-70017df6f28e",
"id": "4c80b3db-3800-41f0-b0f4-c589ffb2e08e",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -178,7 +182,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "d497e0bc-a756-4f05-94d7-174fa45a458c",
"id": "187d8255-1332-4b6e-ac75-ed5710830a7b",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -187,7 +191,7 @@
},
{
"cell_type": "markdown",
"id": "4f60fd2b-66e0-4257-a21c-bdeeece6e8c6",
"id": "68ed263d-326c-4f3f-bfb4-ffb963f8f02b",
"metadata": {
"tags": []
},
Expand All @@ -197,7 +201,7 @@
},
{
"cell_type": "markdown",
"id": "9fdee73b-a79a-461b-9298-053e4523c41d",
"id": "f221d306-9438-4c1f-a59b-ae0b99b5aed5",
"metadata": {},
"source": [
"### 20th Percentile Speeds by Segment"
Expand All @@ -206,19 +210,19 @@
{
"cell_type": "code",
"execution_count": null,
"id": "876ffe14-cc3f-4257-be00-b06ef8363a16",
"id": "12082834-75ee-4715-8e7d-9150d2c8b129",
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, analysis_date=ANALYSIS_DATE,\n",
" time_of_day='Midday', map_type='new_speedmap')"
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, org_shapes=org_shapes,\n",
" analysis_date=ANALYSIS_DATE, time_of_day='Midday', map_type='new_speedmap')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d6858d75-4d44-4ab2-8c44-7f5f91149083",
"id": "cb777a85-5704-4d66-badb-08756e9a317c",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -228,7 +232,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "a1e92ff3-cbe6-45ca-b063-97807caf21c5",
"id": "5171f750-6013-4ca8-bc2f-2bd7678e554f",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -237,7 +241,7 @@
},
{
"cell_type": "markdown",
"id": "296f23f8-026d-4a98-9ce1-43ec2c048b2e",
"id": "816af03a-c7c5-405c-bfbb-1314943d6121",
"metadata": {},
"source": [
"### Variation in Speeds by Segment\n",
Expand All @@ -249,19 +253,19 @@
{
"cell_type": "code",
"execution_count": null,
"id": "31d820ac-0242-47f0-9968-07f4b7122313",
"id": "300161cd-a92a-4260-8ccf-84c5797e6ec6",
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, analysis_date=ANALYSIS_DATE,\n",
" time_of_day='Midday', map_type='new_speed_variation')"
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, org_shapes=org_shapes,\n",
" analysis_date=ANALYSIS_DATE, time_of_day='Midday', map_type='new_speed_variation')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ba8f1e35-3503-41d7-a5ad-60606267cdab",
"id": "71145071-573a-4c97-9d5d-ac19e43b5a97",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -271,7 +275,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "2633b5c9-3510-4690-8b7b-9abbff45b8e0",
"id": "bd852a1e-0cc8-4e6d-acf0-e38b35609deb",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -280,7 +284,7 @@
},
{
"cell_type": "markdown",
"id": "7f5c3087-8fe4-47fc-bccd-d1eb2f8e092e",
"id": "ac317854-05fe-4a96-84b3-664ebffe083d",
"metadata": {
"tags": []
},
Expand All @@ -290,7 +294,7 @@
},
{
"cell_type": "markdown",
"id": "15ced50f-7135-4807-a01f-b9768256b27b",
"id": "bd10bcf2-e91f-475f-a7bb-ea29ed1b8eb6",
"metadata": {},
"source": [
"### 20th Percentile Speeds by Segment"
Expand All @@ -299,19 +303,19 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b341b050-4fa9-4f25-a276-886b3c62a586",
"id": "11cf5818-f909-4d56-b358-b48f29ed256f",
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, analysis_date=ANALYSIS_DATE,\n",
" time_of_day='PM Peak', map_type='new_speedmap')"
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, org_shapes=org_shapes,\n",
" analysis_date=ANALYSIS_DATE, time_of_day='PM Peak', map_type='new_speedmap')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d4cf9996-0239-4cb4-92c5-ed04d57a7b4c",
"id": "c86ef14d-0528-4cb4-a347-55607f547159",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -321,7 +325,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c6ea5f19-d416-4bf5-ab9b-3199af92ed90",
"id": "db6634b3-a794-47a4-a4e2-6a875aea1a0c",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -330,7 +334,7 @@
},
{
"cell_type": "markdown",
"id": "19324dd0-38e2-44b6-9552-2c67f44ffa4a",
"id": "4ebb8a11-b214-4a0e-bd24-f29863d7832b",
"metadata": {},
"source": [
"### Variation in Speeds by Segment\n",
Expand All @@ -342,19 +346,19 @@
{
"cell_type": "code",
"execution_count": null,
"id": "eb50554c-cb63-464d-9d0f-ed722d24f422",
"id": "6e6f502e-7a81-4582-8a70-7c20c0f04bdf",
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, analysis_date=ANALYSIS_DATE,\n",
" time_of_day='PM Peak', map_type='new_speed_variation')"
"link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, org_shapes=org_shapes,\n",
" analysis_date=ANALYSIS_DATE, time_of_day='PM Peak', map_type='new_speed_variation')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b11b79c6-d87d-4563-9cd9-83a5a7294db6",
"id": "7ebde3a1-a6ab-4c23-9105-9b163c47fb0f",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -364,7 +368,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "37190c5b-5943-4172-9a91-892bf36c7a2b",
"id": "7ed2bb7c-dd0e-4aeb-8ebe-2ff9835f6fbb",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -373,7 +377,7 @@
},
{
"cell_type": "markdown",
"id": "73f4bc99-f78f-4f37-b050-5f12cbe4ca7a",
"id": "749a63f1-35d5-4f5e-bc44-871943868e71",
"metadata": {
"tags": []
},
Expand All @@ -386,7 +390,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "40979f68-b80b-4879-8892-3271a74efc8b",
"id": "52ef19f8-4078-4cbd-8049-a01963eb4d06",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -395,7 +399,7 @@
},
{
"cell_type": "markdown",
"id": "5dadca19-df7a-4fc8-8955-210b51f4b1c4",
"id": "70846ffd-28d6-4042-80bc-a79d3959a26e",
"metadata": {},
"source": [
"## Additional Time Periods\n",
Expand All @@ -410,16 +414,16 @@
{
"cell_type": "code",
"execution_count": null,
"id": "05570269-2c18-4d49-b879-b3466e735838",
"id": "6bea466f-f2fb-44b4-a26f-44bcf20abe7a",
"metadata": {},
"outputs": [],
"source": [
"for time_period in [period for period in speedmap_segs.time_of_day.unique() if period not in ['AM Peak', 'Midday', 'PM Peak']]:\n",
" link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, analysis_date=ANALYSIS_DATE,\n",
" time_of_day=time_period, map_type='new_speedmap')\n",
" link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, org_shapes=org_shapes,\n",
" analysis_date=ANALYSIS_DATE, time_of_day=time_period, map_type='new_speedmap')\n",
" speedmap_utils.render_spa_link(link, text=f\"{time_period} Speeds\")\n",
" link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, analysis_date=ANALYSIS_DATE,\n",
" time_of_day=time_period, map_type='new_speed_variation')\n",
" link = speedmap_utils.map_time_period(district_gdf=this_shn, speedmap_segs=speedmap_segs, org_shapes=org_shapes,\n",
" analysis_date=ANALYSIS_DATE, time_of_day=time_period, map_type='new_speed_variation')\n",
" speedmap_utils.render_spa_link(link, text=f\"{time_period} Speed Variation\")"
]
}
Expand All @@ -440,7 +444,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.11.6"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down
1 change: 1 addition & 0 deletions ca_transit_speed_maps/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
generate_speedmaps_quickly:
python update_vars_index.py
python stage_run_portfolio.py
# check console/logs/outputs, then manually deploy via stage_run_portfolio.deploy_portfolio()

clean_speedmap_progress:
rm _rt_progress*
Loading

0 comments on commit 8f8e962

Please sign in to comment.