|
1 | 1 |
|
2 | | -import csv#csv - Comma Separated Values |
3 | | -from gmplot import gmplot |
| 2 | +import csv |
| 3 | +from gmplot import gmplot#importing |
4 | 4 |
|
| 5 | +gmap = gmplot.GoogleMapPlotter(37.771260, -122.511011,17) #17 is here zoom level |
5 | 6 |
|
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: |
11 | 9 | reader=csv.reader(f)
|
12 | 10 | k=0
|
13 | 11 | for row in reader:
|
14 | 12 | lat=float(row[0])
|
15 | 13 | long=float(row[1])
|
16 | 14 |
|
17 | 15 | if k==0:
|
18 | | - gmap.marker(lat, long, 'green')#PLotting Markers |
| 16 | + gmap.marker(lat, long, 'green') |
19 | 17 | k=1
|
20 | 18 | else:
|
21 | | - gmap.marker(lat,long,'blue')#plotting Markers |
| 19 | + gmap.marker(lat,long,'blue') |
22 | 20 |
|
23 | 21 | 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