Skip to content

Commit 0564236

Browse files
committed
begin work on new map viz
1 parent 9838d1a commit 0564236

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

data/elevator escalator gis.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"","station","borough","trainno","equipmentno","equipmenttype","serving","ADA","Station.ID","Complex.ID","GTFS.Stop.ID","Division","Line","Stop.Name","Borough","Daytime.Routes","Structure","GTFS.Latitude","GTFS.Longitude"
1+
"","station","borough","trainno","equipmentno","equipmenttype","serving","ADA","Station.ID","Complex.ID","GTFS.Stop.ID","Division","Line","Stop.Name","Borough","Daytime.Routes","Structure","Latitude","Longitude"
22
"1","125 St","MN","A/B/C/D","EL143","EL","MEZZANINE AND DOWNTOWN","Y",439,439,"225","IRT","Lenox - White Plains Rd","125 St","M","2 3","Subway",40.807754,-73.945495
33
"2","125 St","MN","A/B/C/D","EL143","EL","MEZZANINE AND DOWNTOWN","Y",392,392,"621","IRT","Lexington - Shuttle","125 St","M","4 5 6","Subway",40.804138,-73.937594
44
"3","125 St","MN","A/B/C/D","EL143","EL","MEZZANINE AND DOWNTOWN","Y",153,153,"A15","IND","8th Av - Fulton St","125 St","M","A B C D","Subway",40.811109,-73.952343

map.html

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>NYC Accessibility</title>
6+
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>
7+
</head>
8+
<body>
9+
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.1.js"></script>
10+
<script type="text/javascript"
11+
src="http://cdnjs.cloudflare.com/ajax/libs/jquery-csv/0.71/jquery.csv-0.71.min.js"></script>
12+
13+
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
14+
<div id="map" style="width: 1200px; height: 800px"></div>
15+
<script type="text/javascript" charset="utf-8">
16+
17+
$(document).ready(function() {
18+
$.ajax({
19+
type: "GET",
20+
url: "data/elevator escalator gis.csv",
21+
dataType: "text",
22+
success: function(data){displayData(data)}
23+
});
24+
});
25+
26+
27+
28+
function displayData(file_data){
29+
var map = L.map('map', {
30+
center: new L.LatLng(40.7610312, -73.99729429),
31+
zoom: 11,
32+
});
33+
34+
var baseLayer = L.tileLayer(
35+
'http://{s}.tile.cloudmade.com/ad132e106cd246ec961bbdfbe0228fe8/997/256/{z}/{x}/{y}.png',{
36+
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>',
37+
maxZoom: 20
38+
}
39+
).addTo(map);
40+
41+
data = $.csv.toObjects(file_data);
42+
data_array = [];
43+
for (i = 1; i < data.length; i++) {
44+
lat = parseFloat(data[i].Latitude);
45+
lng = parseFloat(data[i].Longitude);
46+
if (data[i].ADA == "Y") {
47+
console.log(data[i]);
48+
data_array.push([lat, lng, parseFloat(data[i].count)]);
49+
50+
L.circle([lat, lng], 1, {color: 'black'}).addTo(map).bindPopup(data[i].station + " - " + data[i].trainno);
51+
}
52+
};
53+
54+
}
55+
56+
</script>
57+
</body>
58+
</html>

0 commit comments

Comments
 (0)