Skip to content

Instantly share code, notes, and snippets.

@pranavr
pranavr / losangeles_crashes.json
Created April 27, 2014 15:47
You are Here - Bicycle Crash Data - Los Angeles
{
"city":"Los Angeles",
"accidents":[
{
"lat":34.0508631,
"street1":"Grand",
"street2":"Hope",
"year":"2012",
"image_id":0,
"noAccidents":1,
@pranavr
pranavr / chicago_crashes.json
Created April 27, 2014 15:44
You Are Here - Bicycle Crash Data - Chicago
{
"city":"Chicago",
"accidents":[
{
"lat":41.9896199993156,
"severity":2,
"street1":"Clark",
"street2":"Ridge",
"image_id":0,
"year":"2012",
@pranavr
pranavr / sanfrancisco_crashes.json
Created April 27, 2014 15:41
You are Here - San Francisco Bicycle Crash Data
{
"city":"San Francisco",
"accidents":[
{
"lat":37.7726483,
"severity":"u'INJURY",
"street1":"11th St",
"street2":"Kissling St",
"image_id":0,
"year":"2012",
@pranavr
pranavr / portland_accidents.json
Last active August 29, 2015 14:00
You are Here - Bicycle Crash Data - Portland, OR
{
"city":"Portland",
"accidents":[
{
"street1":"Sumner Street",
"street2":"11th Avenue",
"image_id":0,
"noAccidents":1,
"year":"2011",
"lat":45.56061388888889,
@pranavr
pranavr / gist:9811059
Created March 27, 2014 16:05
Lightbox
<p id='map-descp'>
This map visualizes the 956 bicycle accidents that were reported
<br>
in Cambridge between 2010 and 2013...<b id='essayBox-source'>more</b>
</p>
<div id='essayBox'>
<div id='essayBox-close' class="glyphicon glyphicon-remove"></div>
<h1> Essay Title </h1>
# topLeft, bottomRight = [lat, lng],
# numPoints in each row/column, so numPoints = 10 will give you a 10x10 grid.
def makeGrid(topLeft, bottomRight, numPoints):
topLat = topLeft[0]
leftLng = topLeft[1]
bottomLat = bottomRight[0]
rightLng = bottomRight[1]
horizontal_offset = (compute_distance(topLeft, [topLat, rightLng])/numPoints)
<div id='data-lightbox'>
<div id='lightbox-close' class="glyphicon glyphicon-remove"></div>
Milwaukee Avenue, Clark Street, and Ashland Avenue</span> had the most accidents during this time.
<br>
In Chicago, people are commuting with bicycles to work. The southern neighborhoods have a more sporadic pattern.
<br>
The data was given to us by the <a href="http://illinois.gov/" class="footer-highlight-link"> Illinois Government </a>
</div>