Skip to content

Commit

Permalink
Merge pull request #450 from cagov/hang_bottleneck_dashboard
Browse files Browse the repository at this point in the history
Bottleneck Dashboard
  • Loading branch information
thehanggit authored Oct 29, 2024
2 parents b9e8823 + 1be5262 commit 9564e20
Showing 1 changed file with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
with daily_bottleneck_delay as (
select
station_id,
sample_date,
time_shift,
cast(district as int) as district,
station_type,
freeway,
direction,
absolute_postmile,
daily_time_shift_duration,
daily_time_shift_bottleneck_extent,
daily_time_shift_spatial_delay_35_mph,
daily_time_shift_spatial_delay_40_mph,
daily_time_shift_spatial_delay_45_mph,
daily_time_shift_spatial_delay_50_mph,
daily_time_shift_spatial_delay_55_mph,
daily_time_shift_spatial_delay_60_mph,
county
from {{ ref('int_performance__bottleneck_delay_metrics_agg_daily') }}
),

bottleneck_delay_with_county as (
{{ get_county_name('daily_bottleneck_delay') }}
),

geo as (
select distinct
station_id,
latitude,
longitude,
concat(longitude, ',', latitude) as location
from {{ ref('geo__current_detectors') }}
),

bottleneck_delay_county_geo as (
select
bottleneck_delay_with_county.*,
geo.latitude,
geo.longitude,
geo.location
from
bottleneck_delay_with_county
inner join
geo
on bottleneck_delay_with_county.station_id = geo.station_id
)

select * from bottleneck_delay_county_geo

0 comments on commit 9564e20

Please sign in to comment.