-
Notifications
You must be signed in to change notification settings - Fork 0
/
allStopsFeb.py
85 lines (66 loc) · 2.1 KB
/
allStopsFeb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import folium
import json
import csv
import os
filename = 'data/route_stops.csv'
filename1 = 'stops.csv'
filename2 = 'cancelFeb.csv'
filename3 = 'xFeb.csv'
r3 = []
c3 = []
r2 = []
c2 = []
r1 = []
c1 = []
r =[]
c = []
with open(filename, 'r') as csvfile:
csvreader = csv.reader(csvfile)
c=next(csvreader)
for i in csvreader:
r.append(i)
with open(filename1, 'r') as csvfile:
csvreader1 = csv.reader(csvfile)
c1=next(csvreader1)
for j in csvreader1:
r1.append(j)
with open(filename2, 'r') as csvfile:
csvreader2 = csv.reader(csvfile)
c2=next(csvreader2)
for m in csvreader2:
r2.append(m)
with open(filename3, 'r') as csvfile:
csvreader3 = csv.reader(csvfile)
c3=next(csvreader3)
for n in csvreader3:
r3.append(n)
print(r2)
print(c2)
print("==========")
print(r3)
print(c3)
m = folium.Map(location=[45.4215, -75.6972], zoom_start=13)
for k in r1:
# if (k[1] == "11"):
# #print("Here")
# for l in r1:
# if(k[3] == l[0]):
folium.Marker(location=[k[4], k[5]], tooltip=[k[2], k[1]],
icon=folium.Icon(color='blue', icon='bus', prefix='fa')).add_to(m)
for a in r2:
# if(a[2] == "11"):
for b in r3:
if(a[0] == b[0]):
if(b[1] < "2"):
print("Hello")
folium.Marker(location=[a[3], a[4]], tooltip=[a[1], 'Cancellation:', b[1]],
icon=folium.Icon(color='purple', icon='bus', prefix='fa')).add_to(m)
elif(b[1] >= "2" and b[1] < "4"):
print("Hello 1")
folium.Marker(location=[a[3], a[4]], tooltip=[a[1],b[1], 'Cancellations'],
icon=folium.Icon(color='orange', icon='bus', prefix='fa')).add_to(m)
elif(b[1] >= "4"):
print("Hello 2")
folium.Marker(location=[a[3], a[4]], tooltip=[a[1], b[1]],
icon=folium.Icon(color='red', icon='bus', prefix='fa')).add_to(m)
m.save('allStopsMapFeb.html')