This code repository contains an number of scripts to process and analyze data from the Streetlight Data platform for pedestrian and bicyclist crash rate evaluation.
The data was obtained by the Office of the Undersecretary of Transportation for Policy for evaluation purposes. The pilot focuses on 50 intersections in Philadelphia, Pennsylvania, located along the High Injury Network in Philadelphia.
To conduct evaluation of the data, contact Paul Teicher ([email protected]) for access to the data zip file.
The working code is written in R. Recommended setup is to use the latest version of R with the optional open-source development environment RStudio.
Once the data is obtained an unzipped in a folder data
inside this directory, the following code can be run. First, if using RStudio, double-click stld.Rproj
to launch R with the working directory set to this code respository.
Compile_monthly.R
- Compiles the downloaded files across the study period into a single data frame
- Produces plots of bicyclists trip length, trip duration, and index values for each month as time-series plots.
Join_Calc_Crash.R
- Uses the annual total files for Pedestrians, Bicyclists, and Vehicles from Streetlight Data, and joins with crash data from PennDOT.
- Produces crash rate calculations using FHWA methodology for intersections, using vehicle counts as the denominator
- Produces plots and analysis of crash rates for bicyclists, pedestrians, and vehicles for a given study year (2018 or 2019).
Experimental code includes Calibrate_Bicyclists.R
, which assesses which locations with ground-truth crash data could potentially have been used for calibration of the Streetlight Data Index values for bicyclists.