Skip to content

Instantly share code, notes, and snippets.

@matthewoden
Created February 16, 2017 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewoden/dd0a63c5d686be3317aab6df42f1f579 to your computer and use it in GitHub Desktop.
Save matthewoden/dd0a63c5d686be3317aab6df42f1f579 to your computer and use it in GitHub Desktop.
Gunshot Logs

Gunshots or Fireworks

I'm working on a little app that crowdsources the answer to "was that gunshots? or were those fireworks?", roughly 2-5 minutes after the sound was heard.

It's hard to tell in the city sometimes.

Anyway, it does this by checking the public call logs for all St. Louis Metro Police department "calls for service" (so 911 calls, non-emergency calls, etc). The call logs can be found here: http://www.slmpd.org/cfs.aspx

It runs this check every two minutes, and parses the result. After a little data padding (geocoding results and intersections, ISO formatting timestamps, etc), it adds it to a MapSet, so there's exactly one record per result.

About 15 minutes ago, I had these logs:

#MapSet<[
  %CallsForService.ServiceRecord{
    coordinates: %{
      # redacted for privacy     
    }, 
    fireworks: false, 
    gunshots: true, 
    id: "P1702151190",
    location: #redacted for privacy
    time: "2017-02-15 19:40:39",
    type: "Shot Spotter"
  },
  %CallsForService.ServiceRecord{
    coordinates: %{
      lat: #redacted for privacy
      lng: #redacted for privacy
    },
    fireworks: false, 
    gunshots: true, 
    id: "P1702151161",
    location: #redacted for privacy
    time: "2017-02-15 19:16:42",
    type: "Shots Fired"
  }
]>

Now, I have none. Based off the ids on the above url, there are a number of pruned results. Not sure if items are removed if they get dismissed, or what. :/

Notes:

  • Location - The block the call was reported from. Not an exact address.
  • Shot Spotter - Automatic reports submitted by one of these neat dohickeys
  • Shots Fired - a report of shots fired
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment