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 8563924

Browse files
Added Gmplot
1 parent a235977 commit 8563924

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

‎Gmplot-Track the Route/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Description
2+
- You have been provided with a [`CSV`](https://www.bigcommerce.com/ecommerce-answers/what-csv-file-and-what-does-it-mean-my-ecommerce-business/#:~:text=A%20CSV%20is%20a%20comma,Microsoft%20Excel%20or%20Google%20Spreadsheets.)(comma separated value) file in which the **latitudes** and **longitudes** of a specific area are written
3+
_So_ we can track the whole route of a person by reading values of that file on Google Maps and create an Image containing route or location .
4+
_OR_ Just point the location on the map .
5+
6+
# Details
7+
- API Used [`gmplot`](https://github.com/gmplot/gmplot/wiki)
8+
- Library Used [`csv`](https://docs.python.org/3/library/csv.html)
9+
10+
# What to do
11+
1. Take CSV file input **or** any latitudes or longitudes
12+
2. plot the map
13+
3. give output in html file format
14+
15+
# Commands to use
16+
17+
| Command | README |
18+
| ------ | ------ |
19+
| `pip install gmplot` | [Gmplot/PyPI](https://pypi.org/project/gmplot/) |
20+
21+
# CSV File Data
22+
| Latitude | Longitude |
23+
| ------ | ------ |
24+
37.771269, -122.511015
25+
37.773495, -122.464830
26+
37.774797, -122.454538
27+
37.771988, -122.454018
28+
37.773646, -122.440979
29+
37.772742, -122.440797
30+
37.771096, -122.453889
31+
37.768669, -122.453518
32+
37.766227, -122.460213
33+
37.764028, -122.510347
34+
35+
# Author
36+
[Lakhan Kumawat](https://github.com/Lakhankumawat)
37+
38+

‎Gmplot-Track the Route/main.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
import csv #csv - Comma Separated Values
3+
from gmplot import gmplot
4+
5+
6+
gmap = gmplot.GoogleMapPlotter(20.613456, 72.9431185,17) #Plotting data on map
7+
#gmap.coloricon="https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png"
8+
9+
with open('Home/MyPC/Python/LatLong.csv','r') as f: #give the address of csv file with respect to your folder containing .py file
10+
reader=csv.reader(f)
11+
k=0
12+
for row in reader:
13+
lat=float(row[0])
14+
long=float(row[1])
15+
16+
if k==0:
17+
gmap.marker(lat, long, 'green') #PLotting Markers
18+
k=1
19+
else:
20+
gmap.marker(lat,long,'blue') #plotting Markers
21+
22+
gmap.marker(lat,long,'red')
23+
gmap.draw("Output.html") #Taking output in the form of html file

0 commit comments

Comments
(0)

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