Interactive heatmap of car crashes in Hartford between 2015 and 2020 which displays pre-processed data from UConn Crash Data Repository. It can be adapted for other towns in Connecticut, or other states that have similar data.
🎊 A new version of this map is available for Hartford (via datavizforall.org) and West Hartford (via bikewesthartford.org).
- Navigate to https://www.ctcrash.uconn.edu/ and create an account if you don't have one yet.
- Log in, and go to
Data Query Tool
. - Select a
MMUCC(2015-)
dataset, specify dates and town (or multiple towns). - Run the query, and then click
Export To CSV
button above the interactive table. A link will be sent to your email account to download the archive. Note that the tool may prevent you from exporting datasets that are "too large". In that case, break down your query (for example, instead of downloading 2015-2020 data, do 2015-2018 as one export, and 2019-2020 as another). - Unzip the archive(s), and put them inside
data/
folder. - Open
ProcessCrashes.ipynb
notebook, and add your export IDs (numbers) to theexports
list. - Run the notebook. This should generate a CSV (
crashes.csv
) and a JSON file (crashes.json
) with relevant data.
This map is fully front-end, and loads data once from the CSV file using PapaParse JS library. You
can change it to fetch the JSON file using $.getJSON()
function of jQuery, although it is slightly
heavier than the CSV. Modify index.html
to set custom map title, and script.js
to change initial coordinates, date ranges, and anything else related to the map really.
Get in touch with [email protected] if you have any other questions or suggestions!
MIT