Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1dcce19

Browse files
Update main.py
1 parent 6c9c50b commit 1dcce19

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

‎Gmplot-Track the Route/main.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1-
21
import csv
32
from gmplot import gmplot #importing
43

5-
gmap = gmplot.GoogleMapPlotter(37.771260, -122.511011,17) #17 is here zoom level
6-
74
Path=input("Enter the path of your csv file , with filename and extension : ")
5+
Zoom=int(input("Enter your zoom level (less value zoom out , large value zoom in ) : "))
6+
7+
x=0 #for central coordinates x and y
8+
y=0
9+
10+
with open(Path,'r') as f:
11+
reader=csv.reader(f)
12+
k=0
13+
for row in reader:
14+
lat=float(row[0])
15+
long=float(row[1])
16+
x+=lat
17+
y+=long
18+
19+
gmap = gmplot.GoogleMapPlotter(x/(100), y/(100),Zoom) #Zoom level and here total number of coordinates we're taking average
20+
21+
822
with open(Path,'r') as f:
923
reader=csv.reader(f)
1024
k=0
@@ -17,6 +31,7 @@
1731
k=1
1832
else:
1933
gmap.marker(lat,long,'blue')
34+
k=0
2035

2136
gmap.marker(lat,long,'red')
2237
print("Done! Check file Output.html")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /