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 466b983

Browse files
Update main.py
1 parent bab120c commit 466b983

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

‎Gmplot-Track the Route/main.py‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11

2-
import csv#csv - Comma Separated Values
3-
from gmplot import gmplot
2+
import csv
3+
from gmplot import gmplot#importing
44

5+
gmap = gmplot.GoogleMapPlotter(37.771260, -122.511011,17) #17 is here zoom level
56

6-
gmap = gmplot.GoogleMapPlotter(20.613456, 72.9431185,17) #Plotting data on map
7-
8-
Path = input("Enter the csv file path")
9-
10-
with open(Path,'r') as f: #give the address of csv file with respect to your folder containing .py file
7+
Path=input("Enter the path of your csv file , with filename and extension : ")
8+
with open(Path,'r') as f:
119
reader=csv.reader(f)
1210
k=0
1311
for row in reader:
1412
lat=float(row[0])
1513
long=float(row[1])
1614

1715
if k==0:
18-
gmap.marker(lat, long, 'green')#PLotting Markers
16+
gmap.marker(lat, long, 'green')
1917
k=1
2018
else:
21-
gmap.marker(lat,long,'blue')#plotting Markers
19+
gmap.marker(lat,long,'blue')
2220

2321
gmap.marker(lat,long,'red')
24-
gmap.draw("Output.html") #Taking output in the form of html file
22+
print("Done! Check file Output.html")
23+
gmap.draw("Output.html")

0 commit comments

Comments
(0)

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