insight-lane / crash-model

Build a crash prediction modeling application that leverages multiple data sources to generate a set of dynamic predictions we can use to identify potential trouble spots and direct timely safety interventions.
https://insightlane.org
MIT License
112 stars 40 forks source link

Medians #200

Closed j-t-t closed 5 years ago

j-t-t commented 5 years ago

This is a new way of generating intersections, rather than simply looking at whatever falls within buffers around the intersection points, instead grouping whatever falls inside those buffers into connected segments. This fixes an issue where there's a t-intersection that does not cross the median. Prior to these changes, the segment on the opposite side of the median from the intersection would be part of the intersection, and afterwards it will not.

This has been run on Boston, Cambridge, and DC's data, and when visually inspecting Cambridge's data, all the differences appear to be these differences, and I added a bunch of tests for different sorts of intersection cases.

(This PR does not add median as a feature, that will come later)

codecov[bot] commented 5 years ago

Codecov Report

Merging #200 into master will increase coverage by 0.87%. The diff coverage is 86.66%.

@@            Coverage Diff             @@
##           master     #200      +/-   ##
==========================================
+ Coverage   44.55%   45.42%   +0.87%     
==========================================
  Files          28       29       +1     
  Lines        2819     2897      +78     
==========================================
+ Hits         1256     1316      +60     
- Misses       1563     1581      +18