cityofaustin / atd-data-tech

Austin Transportation Data & Technology Services
18 stars 2 forks source link

[Enhancement] Update location trigger logic that uses road part & highway number #11368

Open atdservicebot opened 1 year ago

atdservicebot commented 1 year ago

What application are you using?

Vision Zero (Editor)

With more of a focus on Level 5 roadways, we would like to ensure our comprehensive cost maps (Level 1 to 4 and Level 5 maps) are as accurate as possible. During a recent review we have uncovered some issues with trying to provide more accurate representations of where these crashes are occurring when a level 5 polygon overlaps with level 1-4 polygons.

Goals:

Have the ability to manually update crashes based on corrected road part & highway number and improve the accuracy of assigning the proper street level for analysis and aggregation, including level 5 roadways.

ETL Process (potential changes for discussion in Sprint Review mtg):

Describe the outcome you'd like to see when this feature is implemented:

April 30th, 2023

Requested By Xavier A.

Request ID: DTS23-106320

xavierapostol commented 1 year ago

Let's discuss this topic in the next VZ Sprint Review (Tuesday February 7th, 2023)

patrickm02L commented 1 year ago

In 2/7/23 Planning:

Workarounds

cc: @patrickm02L review

patrickm02L commented 1 year ago

This is something that I think will ultimately fall to Milad, and part of the larger discussion about what to do about #8388

mddilley commented 1 year ago

From Xavier on 04/13/2023:

Given rpt_road_part_id and rpt_hwy_num are manually editable. Here are the steps for identifying a Level 5 location_id

Step 1. Assign a Level 5 location_id (using the filter on the locations table: public.atd_txdot_locations.location_group = 2) to the public.atd_txdot_crashes.location_id field using the following criteria, rpt_road_part_id <> 2 AND UPPER(LTRIM(rpt_hwy_num)) IN ('35', '183', '183A', '1', '290', '71', '360', '620', '45', '130') Step 2. If the criteria in Step 1 is not TRUE, then use existing process to identify the location_id (Street Level 1 through 4) Step 3. If the criteria in Step 1 is not TRUE, then assign a Level 5 location_id (using the filter on the locations table: public.atd_txdot_locations.location_group = 2) to the public.atd_txdot_crashes.location_id field or NULL if all three steps are FALSE

frankhereford commented 1 year ago

If it's helpful, here's the examples of what I needed to do to the SQL snippet to allow it to be inverted via the not keyword:

-- crashes to be excluded from the VZE
--select count(crashes.crash_id)
select crash_id, rpt_road_part_id, UPPER(LTRIM(rpt_hwy_num))
from atd_txdot_crashes crashes
where true
  and crash_date > (now() - interval '5 years')
  and rpt_road_part_id <> 2 
  AND coalesce(
         UPPER(LTRIM(rpt_hwy_num)) 
           IN ('35', '183','183A','1','290','71','360','620','45','130')
         , false);

-- crashes to be included       
--select count(crashes.crash_id)
select crash_id, rpt_road_part_id, UPPER(LTRIM(rpt_hwy_num))
from atd_txdot_crashes crashes
where true
  and crash_date > (now() - interval '5 years')
  AND not( true
   and rpt_road_part_id <> 2 
   and coalesce(
         UPPER(LTRIM(rpt_hwy_num)) 
           IN ('35', '183','183A','1','290','71','360','620','45','130')
         , false)
   );
patrickm02L commented 9 months ago

From Xavier on 04/13/2023:

Given rpt_road_part_id and rpt_hwy_num are manually editable. Here are the steps for identifying a Level 5 location_id Step 1. Assign a Level 5 location_id (using the filter on the locations table: public.atd_txdot_locations.location_group = 2) to the public.atd_txdot_crashes.location_id field using the following criteria, rpt_road_part_id <> 2 AND UPPER(LTRIM(rpt_hwy_num)) IN ('35', '183', '183A', '1', '290', '71', '360', '620', '45', '130') Step 2. If the criteria in Step 1 is not TRUE, then use existing process to identify the location_id (Street Level 1 through 4) Step 3. If the criteria in Step 1 is not TRUE, then assign a Level 5 location_id (using the filter on the locations table: public.atd_txdot_locations.location_group = 2) to the public.atd_txdot_crashes.location_id field or NULL if all three steps are FALSE

2/12/24

Removing highways 360 & 620 because they are traffic controlled.

Note

johnclary commented 1 month ago

I renamed this to better capture what I think is needed—but this issue may just be a dupe. We'll see.