The previous post was all about an open data / open source strategy.
There’s plenty of data available from public sites that can be turned into useful tools, and one of the sources we’ve focused on recently is police response data.
Winston-Salem Police Department publishes a simple text file daily, containing information about all the responses from the previous day: report number, address, time of day, and the type of issue (for example, vandalism, motor vehicle theft, arson, etc.).
But the interface isn’t very useful: no aggregation, no filtering, no visualization, nothing but daily text files.
WSPD does contract with crimemapping.com to display individual responses on a map, which can be filtered going back several months, and users can even receive email alerts for activity within a specified radius of any address.
That’s great! But of course we wondered if an open-source tool would be possible.
So we’ve released a minimal version of a Shiny dashboard as an example:
And we’ve also released the source code here:
At the moment the repository provides:
- Daily data from January 1, 2017 through the day of this post, May 17, 2018, including geocoded locations of each event.
- A tool to download daily data and append it to the existing data (duplicates will be removed automatically).
- A tool to geocode the new daily data, assuming you have a Google Maps API key.
- A Shiny dashboard, which can be run with R (and RStudio, recommended but not necessary). In the app, you filter by date and response type, and displays a simple Plotly line graph or a heatmap of the relevant data. This is just a start – we’ll add more visualization options in future updates.
Installation and update instructions are included in the repository, but please don’t hesitate to contact us if you have trouble getting it to run, or have questions about the code.