This is a series of R markdown documents that processes crash data from the University of Wisconsin's TOPS lab crash data to generate data summaries, maps of school zones, and a dynamic map for exploring the data.
Find a file
2025-02-06 12:47:47 -06:00
api_keys changed directory structure, first move to Makefile 2025-01-27 13:20:09 -06:00
basemaps changed directory structure, first move to Makefile 2025-01-27 13:20:09 -06:00
data changed directory structure, first move to Makefile 2025-01-27 13:20:09 -06:00
data_summaries moved over crash_data_summaries to RMarkdown 2025-01-27 17:22:31 -06:00
docker changed directory structure, first move to Makefile 2025-01-27 13:20:09 -06:00
examples changed example figures 2025-01-27 15:36:10 -06:00
figures added Milwaukee crash map to RMarkdown 2025-01-27 16:51:18 -06:00
html changed directory structure, first move to Makefile 2025-01-27 13:20:09 -06:00
icons changed directory structure, first move to Makefile 2025-01-27 13:20:09 -06:00
parameters county case bug, added refresh basemap parameter 2025-02-06 12:47:47 -06:00
R county case bug, added refresh basemap parameter 2025-02-06 12:47:47 -06:00
.gitignore changed directory structure, first move to Makefile 2025-01-27 13:20:09 -06:00
Makefile county case bug, added refresh basemap parameter 2025-02-06 12:47:47 -06:00
README.md moved over crash_data_summaries to RMarkdown 2025-01-27 17:22:31 -06:00
wisconsin_crashes.Rproj added TOPS_data_process.Rmd 2025-01-27 13:57:54 -06:00

This is a series of RMarkdown files that generates maps of crashes between motor vehicles and bikers and pedestrians in Wisconsin.

Data sources

Example figures

A map of crashes near East High School in Madison, WI:

example routes figure

To process data and generate figures

  • Pre Process TOPS data make TOPS_data_process: This combines TOPS data exports from different years and reformats the data.
  • OpenStreetMap Routing Machine make osrm: this downloads the most recent OpenStreetMap data for Wisconsin, and starts docker containers to run the OpenStreetMap Routing Machine to calculate IsoDistances.
  • School Crash Maps make schoolpdfs: generates maps of all the schools in Wisconsin and where cars are hitting kids This script pulls in the TOPS data from a folder of csvs that youve downloaded from the data retrieval tool. It also draws the walk boundary around each school, this is done with a OpenStreetMap routing engine that is running in a docker container. It also needs access to an API key for StadiaMaps to download all the basemap tiles. I recommend downloading the whole state and filtering the data with the script. You can edit file parameters/run_parameters to choose what county, school type, and district to generate maps for
  • Dynamic Map make crashmaps_dynamic: This takes the TOPS data and generates dynamic leaflet maps to host on our website. It generates 4 maps: without a title (for in a frame), and with a title, in both English and Spanish.
  • Milwaukee Specific map crashmaps_dynamic_milwaukee: generate a web map for Milwaukee that includes more fine-grained visualizations of crash densities.
  • Crash summaries make crash_data_summaries: generates summary csv files that summarize the crash data for a given municipality and county by age, sex, race.

R Scripts

I'm working to move these to RMarkdown files

  • City maps - generates maps for cities in Wisconsin where pedestrian fatalities occur.