Winston-Salem Police Response Data

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 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:

  1. Daily data from January 1, 2017 through the day of this post, May 17, 2018, including geocoded locations of each event.
  2. A tool to download daily data and append it to the existing data (duplicates will be removed automatically).
  3. A tool to geocode the new daily data, assuming you have a Google Maps API key.
  4. 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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: