Category Archives: DataViz

Ruby: Using Google Maps Heat Map to Display Chicago Crime Statistics

Each crime report contains latitude and longitude coordinates.  I used ruby to parse out each coordinate from this source :  https://data.cityofchicago.org.  Then I appended those points into a heat map.

Update: This dataset has been expanded on, in this post DataViz: Visualizing Chicago Narcotics Crime Data.

Chicago DECEPTIVE PRACTICE – 8/8/2012 to 8/8/2013

DECEPTIVE PRACTICE

Chicago ALL CRIMES – 8/8/2012 to 8/8/2013
HEATMAPOFCRIME

Chicago NARCOTICS – 8/8/2012 to 8/8/2013
NARCOTICS

Chicago HOMICIDE – 8/8/2012 to 8/8/2013
murderonlysat

Ruby example to parse all coordinates for Primary Crime Type: DECEPTIVE PRACTICE
RUBY

Output
output

Ruby: Using Google Charts to Graph Chicago Crime Data

Recently I decided to visualize some of Chicago’s Crime Data.  I used ruby to parse and manicure it into JSON, and Google Charts to display it.

The Data is from : https://data.cityofchicago.org/

Google Charts API : https://developers.google.com/chart/

The data was saved in CSV format on my local C: Drive
Local Path : C:\ChicagoCrime\CHICAGOCRIME.csv
Data chosen ranges from 8/8/2012 to 8/8/2013

Ruby Code used to create the JSON
Ruby Chicago Crime

JSON Output
JSONOUTPUT

Column Chart Created
chicago crimes