Giter Club home page Giter Club logo

mapping-seattle-911's Introduction

mapping-seattle-911

The purpose of this data exploration is an answer a simple question: Where do cardiac arrests occur in Seattle, WA? This type of analysis can be useful for staging ambulances, positioning AEDs, and targeting community enagagement. animated time series map of seattle 911 dispatched for Medical emergencies

The purpose of this project is to faciliate mapping and geospatial analysis of open source Seattle Fire Realtime 911 data, with a particular focus on out of hospital cardiac arrest (OHCA).

Out of Hospital Cardiac Arrest is a life threatening emergency. Prompt initation of high quality CPR, early defibrilation, and advanced life support and transport to a suitable medical center can dramatically improve outcomes. Because of the time sensitive nature of cardiac arrest resuscitation, geospatial analysis of where cardiac arrests occur is potentially useful. Thus, identifying 'hotspots' for OHCA can conceivable be used in several different ways:

  • it can be used to determine where to place AEDs
  • it can be used to determine staging locations for ambulances

initial data exploration

  • You can see the realtime feed of 911 dispatches which is a fairly unique level of transparency provided by the City of Seattle. In another repository, I show you we can use this near-realtime feed to predict ED visits.
  • I pull data from the Seattle Fire 911 API provided by the Seattle Open Data Program.
  • I use the incident type "Medical Response, 7 per rule" to identify high acuity medical emergencies, of which OHCA is one particular subtype. This is not quite perfect (it also includes medical emergencies like 'person not breathing' but it's a good first pass approximation.

incident type example

  • Next I loaded the flat file (.csv) into powerBI and used ArcGIS esri to explore the data. Unfortunately, there are so many events it can be hard to identify patterns, even if we create an automated time slicer:

animated time series map of seattle 911 dispatched for Medical emergencies

  • We can use alternative visualization tools, such as MapBox to build simple heatmaps. This starts to show us some more subtle patterns in the data.

  • But what if we want more nuanced control of the visualization? For this it helps to use the GoogleMaps API directly.
  • I export the GPS coordinates of these events and load them into the Google Maps Javascript API where I display the events as a heatmap.
  • The Google maps API makes it easy to zoom and translate on the map. You can adjust the color scheme, and the heatmap gradient, and other parameters
var map, heatmap;\
// load map centered on Seattle, default is roadmap\
function initMap() \{\
  map = new google.maps.Map(document.getElementById('map'), \{\
    zoom: 11,\
    center: \{lat: 47.63, lng: -122.35\},\
    mapTypeId: 'roadmap'\
  \});\
\
// ideally would like to have multiple different heatmaps, for now just one\
  heatmap = new google.maps.visualization.HeatmapLayer(\{\
    data: getPoints(),\
    map: map\
  \});\
\}\
\
// default = red/green, alternative = red/blue\
function toggleHeatmap() \{\
  heatmap.setMap(heatmap.getMap() ? null : map);\ 
\}\
function changeRadius() \{\
  heatmap.set('radius', heatmap.get('radius') ? null : 19);\
\}\
\
function changeOpacity() \{\
  heatmap.set('opacity', heatmap.get('opacity') ? null : 0.2);\
\}\

example image

  • This is a much more efficient way to specify some of the parameters for visualization. We can also make it more user friendly and interactive.
  • The final live map of OHCA in Seattle can be found here:
  • https://jsfiddle.net/user/nickmmark/fiddles/
<script async src="//jsfiddle.net/nickmmark/j6k2vhg0/embed/"></script>

mapping cardiac arrest calls in Seattle, WA

Data Source(s)

Version/To-Do

v1.0 by Nick Mark, 7/16/2017

  • need to load census data for population density to normalize
  • would also be helpful to explore by ZIP and aggregate

References

mapping-seattle-911's People

Contributors

nickmmark avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.