Skip to content

Instantly share code, notes, and snippets.

@ZacSweers
Forked from blech/caltrain.geojson
Created November 6, 2015 07:57
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 ZacSweers/99d61295437042746dd9 to your computer and use it in GitHub Desktop.
Save ZacSweers/99d61295437042746dd9 to your computer and use it in GitHub Desktop.
Caltrain Ridership
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
{"type":"FeatureCollection",
"dotspotting:title":"Caltrain ridership",
"dotspotting:extent":"37.003394, -122.406619, 37.776627, -121.567049",
"features":[
{"type":"Feature","id":"562655","geometry":{"type":"Point","coordinates":[-122.394397,37.776627]},"properties":{"id":"562655","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q8yyv50gcdv","2013":"10786","2012":"9670","2011":"8897","2010":"8038","2009":"7996","address":"700 4th St., San Francisco 94107","station":"San Francisco"}},
{"type":"Feature","id":"562657","geometry":{"type":"Point","coordinates":[-122.392579,37.757679]},"properties":{"id":"562657","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q8yycs6qjw2","2013":"1312","2012":"1252","2011":"1036","2010":"840","2009":"863","address":"1149 22nd St., San Francisco 94107","station":"22nd Street"}},
{"type":"Feature","id":"562659","geometry":{"type":"Point","coordinates":[-122.40137,37.709715]},"properties":{"id":"562659","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q8yw8y5127k","2013":"195","2012":"165","2011":"138","2010":"125","2009":"134","address":"400 Tunnel Ave., San Francisco 94134","station":"Bayshore"}},
{"type":"Feature","id":"562661","geometry":{"type":"Point","coordinates":[-122.40571,37.657045]},"properties":{"id":"562661","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q8ynx6bhjzr","2013":"361","2012":"389","2011":"365","2010":"298","2009":"319","address":"590 Dubuque Ave., South San Francisco 94080","station":"So. San Francisco"}},
{"type":"Feature","id":"562663","geometry":{"type":"Point","coordinates":[-122.406619,37.621335]},"properties":{"id":"562663","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q8yn8f0pj1k","2013":"437","2012":"432","2011":"403","2010":"343","2009":"414","address":"297 Huntington Ave., San Bruno 94066","station":"San Bruno"}},
{"type":"Feature","id":"562665","geometry":{"type":"Point","coordinates":[-122.386678,37.599123]},"properties":{"id":"562665","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q8vzh8wz8w9","2013":"3255","2012":"2880","2011":"2600","2010":"2410","2009":"2649","address":"100 California Drive, Millbrae 94030","station":"Millbrae"}},
{"type":"Feature","id":"562667","geometry":{"type":"Point","coordinates":[-122.344929,37.579513]},"properties":{"id":"562667","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q8vzcphs8by","2013":"792","2012":"749","2011":"675","2010":"606","2009":"674","address":"290 California Drive, Burlingame 94010","station":"Burlingame"}},
{"type":"Feature","id":"562669","geometry":{"type":"Point","coordinates":[-122.323859,37.567185]},"properties":{"id":"562669","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9j8qykxqzg","2013":"1571","2012":"1477","2011":"1347","2010":"1195","2009":"1340","address":"385 First Ave., San Mateo 94401","station":"San Mateo"}},
{"type":"Feature","id":"562671","geometry":{"type":"Point","coordinates":[-122.309031,37.552585]},"properties":{"id":"562671","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9j8u1r9j0r","2013":"331","2012":"327","2011":"288","2010":"208","2009":"215","address":"401 Concar Drive, San Mateo 94402","station":"Hayward Park"}},
{"type":"Feature","id":"562673","geometry":{"type":"Point","coordinates":[-122.297367,37.537045]},"properties":{"id":"562673","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9j913v0u3e","2013":"2317","2012":"2097","2011":"1883","2010":"1707","2009":"1824","address":"3333 El Camino Real, San Mateo 94403","station":"Hillsdale"}},
{"type":"Feature","id":"562675","geometry":{"type":"Point","coordinates":[-122.311593,37.550015]},"properties":{"id":"562675","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9j8ez2tq1u","2013":"509","2012":"454","2011":"369","2010":"361","2009":"418","address":"995 El Camino Real, Belmont 94402","station":"Belmont"}},
{"type":"Feature","id":"562677","geometry":{"type":"Point","coordinates":[-122.260009,37.507564]},"properties":{"id":"562677","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9j3uhcrk9y","2013":"1138","2012":"1004","2011":"937","2010":"802","2009":"921","address":"599 El Camino Real, San Carlos 94070","station":"San Carlos"}},
{"type":"Feature","id":"562679","geometry":{"type":"Point","coordinates":[-122.23192,37.485421]},"properties":{"id":"562679","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9j6812mufq","2013":"2619","2012":"2399","2011":"2106","2010":"1878","2009":"2004","address":"1 James Ave., Redwood City, Ca. 94063","station":"Redwood City"}},
{"type":"Feature","id":"562681","geometry":{"type":"Point","coordinates":[-122.182266,37.454353]},"properties":{"id":"562681","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9j5dme6v7n","2013":"1526","2012":"1471","2011":"1312","2010":"1252","2009":"1334","address":"1120 Merrill St., Menlo Park 94025","station":"Menlo Park"}},
{"type":"Feature","id":"562683","geometry":{"type":"Point","coordinates":[-122.164046,37.443544]},"properties":{"id":"562683","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9jh06u7qt0","2013":"5469","2012":"4661","2011":"4028","2010":"3582","2009":"3621","address":"95 University Ave., Palo Alto 94301","station":"Palo Alto"}},
{"type":"Feature","id":"562685","geometry":{"type":"Point","coordinates":[-122.142588,37.428497]},"properties":{"id":"562685","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9hutdkz3t3","2013":"1294","2012":"1069","2011":"895","2010":"777","2009":"786","address":"101 California Ave., Palo Alto 94306","station":"California Ave."}},
{"type":"Feature","id":"562687","geometry":{"type":"Point","coordinates":[-122.10716,37.407202]},"properties":{"id":"562687","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9hv3u28zy7","2013":"675","2012":"611","2011":"478","2010":"492","2009":"587","address":"190 Showers Drive, Mountain View, 94040","station":"San Antonio"}},
{"type":"Feature","id":"562689","geometry":{"type":"Point","coordinates":[-122.078057,37.395133]},"properties":{"id":"562689","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9hwp96rn51","2013":"3876","2012":"3670","2011":"3368","2010":"3049","2009":"3209","address":"600 W. Evelyn Ave., Mountain View 94041","station":"Mountain View"}},
{"type":"Feature","id":"562691","geometry":{"type":"Point","coordinates":[-122.030366,37.378037]},"properties":{"id":"562691","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9hxhkny7h5","2013":"2274","2012":"1965","2011":"1787","2010":"1625","2009":"1779","address":"121 W. Evelyn Ave., Sunnyvale 94086","station":"Sunnyvale"}},
{"type":"Feature","id":"562693","geometry":{"type":"Point","coordinates":[-121.996962,37.371556]},"properties":{"id":"562693","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9hxgk90dzz","2013":"700","2012":"606","2011":"531","2010":"497","2009":"567","address":"137 San Zeno Way, Sunnyvale 94086","station":"Lawrence"}},
{"type":"Feature","id":"562695","geometry":{"type":"Point","coordinates":[-121.936636,37.353188]},"properties":{"id":"562695","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9k3rbqn6yj","2013":"822","2012":"715","2011":"656","2010":"591","2009":"683","address":"1001 Railroad Ave., Santa Clara 95050","station":"Santa Clara"}},
{"type":"Feature","id":"562697","geometry":{"type":"Point","coordinates":[-121.914499,37.341664]},"properties":{"id":"562697","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9k3vbdfq8w","2013":"87","2012":"85","2011":"74","2010":"58","2009":"107","address":"780 Stockton Ave., San Jose 95126","station":"College Park"}},
{"type":"Feature","id":"562699","geometry":{"type":"Point","coordinates":[-121.902405,37.329931]},"properties":{"id":"562699","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9k659qs5d8","2013":"3489","2012":"3187","2011":"2681","2010":"2517","2009":"2783","address":"65 Cahill St., San Jose 95110","station":"San Jose Diridon"}},
{"type":"Feature","id":"562701","geometry":{"type":"Point","coordinates":[-121.882561,37.311233]},"properties":{"id":"562701","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9k62rcdmzq","2013":"807","2012":"653","2011":"577","2010":"544","2009":"613","address":"1355 Lick Ave., San Jose 95110","station":"Tamien"}},
{"type":"Feature","id":"562703","geometry":{"type":"Point","coordinates":[-121.798295,37.25558]},"properties":{"id":"562703","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q97uqjjqp2x","2013":"44","2012":"27","2011":"19","2010":"21","2009":"32","address":"3400 Monterey Hwy., San Jose 95111","station":"Capitol"}},
{"type":"Feature","id":"562705","geometry":{"type":"Point","coordinates":[-121.798295,37.25558]},"properties":{"id":"562705","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q97uqjjqp2x","2013":"66","2012":"66","2011":"68","2010":"45","2009":"61","address":"5560 Monterey Hwy., San Jose 95138","station":"Blossom Hill"}},
{"type":"Feature","id":"562707","geometry":{"type":"Point","coordinates":[-121.650295,37.129155]},"properties":{"id":"562707","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q97pz0vn8js","2013":"133","2012":"113","2011":"106","2010":"101","2009":"115","address":"17300 Depot St., Morgan Hill 95037","station":"Morgan Hill"}},
{"type":"Feature","id":"562709","geometry":{"type":"Point","coordinates":[-121.610726,37.08546]},"properties":{"id":"562709","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9dbxjy2wy3","2013":"49","2012":"43","2011":"43","2010":"43","2009":"43","address":"13400 Monterey Hwy., San Martin 95046","station":"San Martin"}},
{"type":"Feature","id":"562711","geometry":{"type":"Point","coordinates":[-121.567049,37.003394]},"properties":{"id":"562711","sheet_id":"2969","user_id":"302","perms":"public","created":"2014-02-06 04:33:24","geohash":"9q9d98m86kw5","2013":"129","2012":"116","2011":"113","2010":"113","2009":"142","address":"7150 Monterey St., Gilroy 95020","station":"Gilroy"}}
]}
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Caltrain Ridership | blech.github.io</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src='//api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.js'></script>
<script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-hash/v0.2.1/leaflet-hash.js'></script>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.css' rel='stylesheet' />
<link href="/geojson/{{ date }}" rel="geojson" type="application/json">
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script>
var map = L.mapbox.map('map', 'paulmison.gofl3m15')
.setView([37.5326, -122.1305], 11);
var hash = new L.Hash(map);
var draw_geojson = function(data) {
var markerLayer = L.mapbox.markerLayer()
markerLayer.setGeoJSON(data).addTo(map);
map.fitBounds(markerLayer.getBounds());
};
var draw_data = function(data) {
var featureGroup = L.featureGroup().addTo(map);
var options = {
color: '#000', // Stroke color
opacity: 1, // Stroke opacity
weight: 1, // Stroke weight
fillColor: '#933', // Fill color
fillOpacity: 0.6 // Fill opacity
};
for (var i = 0; i < data['features'].length; i++) {
feature = data['features'][i]
console.log(feature['geometry']['coordinates'])
console.log(feature['properties'])
var coords = [feature['geometry']['coordinates'][1], feature['geometry']['coordinates'][0]]
var radius = Math.sqrt(200*feature['properties']['2013'])
var circle = L.circle(coords, radius, options).addTo(featureGroup);
}
}
$.getJSON('/blech/raw/8838444/caltrain.geojson', draw_geojson);
$.getJSON('/blech/raw/8838444/dotspotting-sheet-2969.json', draw_data);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment