-
Notifications
You must be signed in to change notification settings - Fork 2
/
gps.py
45 lines (36 loc) · 1.01 KB
/
gps.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 21 13:38:23 2018
@author: manveet
"""
# =============================================================================
# import csv
# with open('route.csv','r+') as f:
# reader = csv.reader(f)
#
# for row in reader:
# lat = row[0]
# long = row[1]
# print(lat)
# print(long)
# print(float(lat)+float(long))
#
# =============================================================================
import csv
from gmplot import gmplot
gmap = gmplot.GoogleMapPlotter(28.689169, 77.324448, 17)
gmap.coloricon = "http://www.googlemapsmarkers.com/v1/%s/"
with open('route.csv', 'r') as f:
reader = csv.reader(f)
k = 0
for row in reader:
lat = float(row[0])
long = float(row[1])
if(k == 0):
gmap.marker(lat,long, 'yellow')
k = 1
else:
gmap.marker(lat,long, 'blue')
gmap.marker(lat,long, 'red')
gmap.draw("mymap.html")