Skip to content

Fork of Code for Boston project to provide public access to incident logs from the Boston Police Dept. Using Firebase to allow better data analysis than original application.

acharliekelly/police-incident-dashboard-react

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[WIP] Boston Police Incident Dashboard

A visualization of crime incidents as reported by the Boston Police department. See it here: https://filipemir.github.io/police-incident-dashboard-react/

This is a project initially started by Code for Boston volunteers during the 2019 National Day of Civic Hacking. The goal is to create a dashboard that can be used by the DA's staff, investigators, legal advocates, watchdogs, and researchers to better understand how law enforcement is coming in contact with the community.

We're currently tracking the work we need to do here. PRs are very welcome!

Technology

The dashboard is a lightweight static web app that queries the City of Boston's data API directly for its data. We might consider adding a backend later down the road if the requirements evolve beyond what we can do with the data we can easily query from the city's API

Stack thus far:

Data

The app relies on data made available by the City of Boston which is updated in real-time as incident reports are filed by BPD officers. The database is a postgres DB fronted through a CKAN API. In practice this means we submit SQL statements through a REST endpoint to get the data we need.

Take a peek at the data on the data.boston.gov website: https://data.boston.gov/dataset/crime-incident-reports-august-2015-to-date-source-new-system/resource/12cb3883-56f5-47de-afa5-3b1cf61b257b

And some sample queries through the API:

# Incidents by date:
https://data.boston.gov/api/3/action/datastore_search_sql?sql=SELECT * from "12cb3883-56f5-47de-afa5-3b1cf61b257b" WHERE "OCCURRED_ON_DATE" BETWEEN '2019-09-19 00:00' and '2019-09-20 00:00' limit 10

# Total number of incidents
https://data.boston.gov/api/3/action/datastore_search_sql?sql=SELECT COUNT("_id") from "12cb3883-56f5-47de-afa5-3b1cf61b257b"

# Total number of incidents bogus Lat/Longs
https://data.boston.gov/api/3/action/datastore_search_sql?sql=SELECT COUNT("_id") from "12cb3883-56f5-47de-afa5-3b1cf61b257b" where "Lat" = '-1' or "Long" = '-1' or "Lat" is NULL or "Long" is NULL

Development

  • npm start: Runs the app in the development mode. Open http://localhost:3000 to view it in the browser. The page will reload if you make edits.
  • npm run deploy: Builds the app for production to the build folder, commits it to the gh-pages branch, which will update the deployed version of the app.

Vizualization Wishlist

A quick list of ideas we brainstomed during NDCH 2019:

  • Real-time Map of Incidents, color-coded and filterable by type and time
  • Change in Incident Rates (by type) over time
  • Impact of DA office actions (layer of Data to add)
  • Overlay Boston Police neighborhoods SHP files
  • Court loads by jurisdiction (aggregate by Nasser's SHP files)
  • Field Interrogation and Observation (FIO) -> Stop and Frisk data on data.boston.gov (stale data not update since Dec 2016 sadoy)

Other Resources

About

Fork of Code for Boston project to provide public access to incident logs from the Boston Police Dept. Using Firebase to allow better data analysis than original application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 81.9%
  • CSS 16.0%
  • HTML 2.1%