From 8563924556ff387abd303134b4f50a6ab631a91a Mon Sep 17 00:00:00 2001 From: LakhanKumawat <55774240+Lakhankumawat@users.noreply.github.com> Date: Fri, 26 Mar 2021 15:38:45 +0530 Subject: [PATCH 01/10] Added Gmplot --- Gmplot-Track the Route/README.md | 38 ++++++++++++++++++++++++++++++++ Gmplot-Track the Route/main.py | 23 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 Gmplot-Track the Route/README.md create mode 100644 Gmplot-Track the Route/main.py diff --git a/Gmplot-Track the Route/README.md b/Gmplot-Track the Route/README.md new file mode 100644 index 0000000000..eb88b4764e --- /dev/null +++ b/Gmplot-Track the Route/README.md @@ -0,0 +1,38 @@ +# Description +- 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 +_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 . +_OR_ Just point the location on the map . + +# Details +- API Used [`gmplot`](https://github.com/gmplot/gmplot/wiki) +- Library Used [`csv`](https://docs.python.org/3/library/csv.html) + +# What to do +1. Take CSV file input **or** any latitudes or longitudes +2. plot the map +3. give output in html file format + +# Commands to use + +| Command | README | +| ------ | ------ | +| `pip install gmplot` | [Gmplot/PyPI](https://pypi.org/project/gmplot/) | + +# CSV File Data + | Latitude | Longitude | + | ------ | ------ | + 37.771269, -122.511015 + 37.773495, -122.464830 + 37.774797, -122.454538 + 37.771988, -122.454018 + 37.773646, -122.440979 + 37.772742, -122.440797 + 37.771096, -122.453889 + 37.768669, -122.453518 + 37.766227, -122.460213 + 37.764028, -122.510347 + + # Author + [Lakhan Kumawat](https://github.com/Lakhankumawat) + + diff --git a/Gmplot-Track the Route/main.py b/Gmplot-Track the Route/main.py new file mode 100644 index 0000000000..e9af10c1a0 --- /dev/null +++ b/Gmplot-Track the Route/main.py @@ -0,0 +1,23 @@ + +import csv #csv - Comma Separated Values +from gmplot import gmplot + + +gmap = gmplot.GoogleMapPlotter(20.613456, 72.9431185,17) #Plotting data on map +#gmap.coloricon="https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png" + +with open('Home/MyPC/Python/LatLong.csv','r') as f: #give the address of csv file with respect to your folder containing .py file + 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, 'green') #PLotting Markers + k=1 + else: + gmap.marker(lat,long,'blue') #plotting Markers + +gmap.marker(lat,long,'red') +gmap.draw("Output.html") #Taking output in the form of html file From f6cfbff1ce553b020b75eadabe677708b476ee3b Mon Sep 17 00:00:00 2001 From: LakhanKumawat <55774240+Lakhankumawat@users.noreply.github.com> Date: Sat, 27 Mar 2021 13:25:30 +0530 Subject: [PATCH 02/10] Update README Modified author's name in readme , removed unnecessary spaces --- Gmplot-Track the Route/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Gmplot-Track the Route/README.md b/Gmplot-Track the Route/README.md index eb88b4764e..1774712334 100644 --- a/Gmplot-Track the Route/README.md +++ b/Gmplot-Track the Route/README.md @@ -32,7 +32,6 @@ _OR_ Just point the location on the map . 37.766227, -122.460213 37.764028, -122.510347 - # Author - [Lakhan Kumawat](https://github.com/Lakhankumawat) +### Author : [Lakhan Kumawat](https://github.com/Lakhankumawat) From bab120c70be64c0eb45fe04d515c28e2d44f7d5c Mon Sep 17 00:00:00 2001 From: LakhanKumawat <55774240+Lakhankumawat@users.noreply.github.com> Date: Sat, 27 Mar 2021 13:27:55 +0530 Subject: [PATCH 03/10] Update main.py --- Gmplot-Track the Route/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gmplot-Track the Route/main.py b/Gmplot-Track the Route/main.py index e9af10c1a0..8c7e3dc518 100644 --- a/Gmplot-Track the Route/main.py +++ b/Gmplot-Track the Route/main.py @@ -4,9 +4,10 @@ gmap = gmplot.GoogleMapPlotter(20.613456, 72.9431185,17) #Plotting data on map -#gmap.coloricon="https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png" -with open('Home/MyPC/Python/LatLong.csv','r') as f: #give the address of csv file with respect to your folder containing .py file +Path = input("Enter the csv file path") + +with open(Path,'r') as f: #give the address of csv file with respect to your folder containing .py file reader=csv.reader(f) k=0 for row in reader: From 466b98353c5592a1ec3f689b48e4b04ba684e269 Mon Sep 17 00:00:00 2001 From: LakhanKumawat <55774240+Lakhankumawat@users.noreply.github.com> Date: Tue, 30 Mar 2021 12:42:52 +0530 Subject: [PATCH 04/10] Update main.py --- Gmplot-Track the Route/main.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Gmplot-Track the Route/main.py b/Gmplot-Track the Route/main.py index 8c7e3dc518..38239286a5 100644 --- a/Gmplot-Track the Route/main.py +++ b/Gmplot-Track the Route/main.py @@ -1,13 +1,11 @@ -import csv #csv - Comma Separated Values -from gmplot import gmplot +import csv +from gmplot import gmplot #importing +gmap = gmplot.GoogleMapPlotter(37.771260, -122.511011,17) #17 is here zoom level -gmap = gmplot.GoogleMapPlotter(20.613456, 72.9431185,17) #Plotting data on map - -Path = input("Enter the csv file path") - -with open(Path,'r') as f: #give the address of csv file with respect to your folder containing .py file +Path=input("Enter the path of your csv file , with filename and extension : ") +with open(Path,'r') as f: reader=csv.reader(f) k=0 for row in reader: @@ -15,10 +13,11 @@ long=float(row[1]) if k==0: - gmap.marker(lat, long, 'green') #PLotting Markers + gmap.marker(lat, long, 'green') k=1 else: - gmap.marker(lat,long,'blue') #plotting Markers + gmap.marker(lat,long,'blue') gmap.marker(lat,long,'red') -gmap.draw("Output.html") #Taking output in the form of html file +print("Done! Check file Output.html") +gmap.draw("Output.html") From 7389587eec13ed272c039581dd560879eaea53dc Mon Sep 17 00:00:00 2001 From: LakhanKumawat <55774240+Lakhankumawat@users.noreply.github.com> Date: Tue, 30 Mar 2021 12:44:22 +0530 Subject: [PATCH 05/10] Update README.md --- Gmplot-Track the Route/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Gmplot-Track the Route/README.md b/Gmplot-Track the Route/README.md index 1774712334..1ccdcf61c5 100644 --- a/Gmplot-Track the Route/README.md +++ b/Gmplot-Track the Route/README.md @@ -32,6 +32,9 @@ _OR_ Just point the location on the map . 37.766227, -122.460213 37.764028, -122.510347 -### Author : [Lakhan Kumawat](https://github.com/Lakhankumawat) +# Outcome +Screenshot-40 + +## Author : [Lakhan Kumawat](https://github.com/Lakhankumawat) From 6c9c50b97d38d3867cecb77ddd8d8532f036d496 Mon Sep 17 00:00:00 2001 From: LakhanKumawat <55774240+Lakhankumawat@users.noreply.github.com> Date: Tue, 30 Mar 2021 12:45:03 +0530 Subject: [PATCH 06/10] Add CSV file --- Gmplot-Track the Route/LatLong.csv | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Gmplot-Track the Route/LatLong.csv diff --git a/Gmplot-Track the Route/LatLong.csv b/Gmplot-Track the Route/LatLong.csv new file mode 100644 index 0000000000..f7ee0656a8 --- /dev/null +++ b/Gmplot-Track the Route/LatLong.csv @@ -0,0 +1,10 @@ +37.771269, -122.511015 +37.773495, -122.464830 +37.774797, -122.454538 +37.771988, -122.454018 +37.773646, -122.440979 +37.772742, -122.440797 +37.771096, -122.453889 +37.768669, -122.453518 +37.766227, -122.460213 +37.764028, -122.510347 \ No newline at end of file From 1dcce19e8ee10a58a50240bcac20f991e3d9f09f Mon Sep 17 00:00:00 2001 From: LakhanKumawat <55774240+Lakhankumawat@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:13:58 +0530 Subject: [PATCH 07/10] Update main.py --- Gmplot-Track the Route/main.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Gmplot-Track the Route/main.py b/Gmplot-Track the Route/main.py index 38239286a5..225de8f50a 100644 --- a/Gmplot-Track the Route/main.py +++ b/Gmplot-Track the Route/main.py @@ -1,10 +1,24 @@ - import csv from gmplot import gmplot #importing -gmap = gmplot.GoogleMapPlotter(37.771260, -122.511011,17) #17 is here zoom level - Path=input("Enter the path of your csv file , with filename and extension : ") +Zoom=int(input("Enter your zoom level (less value zoom out , large value zoom in ) : ")) + +x=0 #for central coordinates x and y +y=0 + +with open(Path,'r') as f: + reader=csv.reader(f) + k=0 + for row in reader: + lat=float(row[0]) + long=float(row[1]) + x+=lat + y+=long + +gmap = gmplot.GoogleMapPlotter(x/(100), y/(100),Zoom) #Zoom level and here total number of coordinates we're taking average + + with open(Path,'r') as f: reader=csv.reader(f) k=0 @@ -17,6 +31,7 @@ k=1 else: gmap.marker(lat,long,'blue') + k=0 gmap.marker(lat,long,'red') print("Done! Check file Output.html") From 12a545c1122e3adb50caa9089365a581a7f67820 Mon Sep 17 00:00:00 2001 From: LakhanKumawat <55774240+Lakhankumawat@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:14:44 +0530 Subject: [PATCH 08/10] Update LatLong.csv --- Gmplot-Track the Route/LatLong.csv | 110 ++++++++++++++++++++++++++--- 1 file changed, 100 insertions(+), 10 deletions(-) diff --git a/Gmplot-Track the Route/LatLong.csv b/Gmplot-Track the Route/LatLong.csv index f7ee0656a8..56a655bc93 100644 --- a/Gmplot-Track the Route/LatLong.csv +++ b/Gmplot-Track the Route/LatLong.csv @@ -1,10 +1,100 @@ -37.771269, -122.511015 -37.773495, -122.464830 -37.774797, -122.454538 -37.771988, -122.454018 -37.773646, -122.440979 -37.772742, -122.440797 -37.771096, -122.453889 -37.768669, -122.453518 -37.766227, -122.460213 -37.764028, -122.510347 \ No newline at end of file +28.6600,77.2300 +18.9667,72.8333 +22.5411,88.3378 +12.9699,77.5980 +13.0825,80.2750 +17.3667,78.4667 +18.5196,73.8553 +23.0300,72.5800 +21.1700,72.8300 +26.8470,80.9470 +26.9167,75.8667 +26.4725,80.3311 +25.1500,82.5800 +21.1539,79.0831 +28.6667,77.4167 +22.7206,75.8472 +22.3000,73.2000 +17.7333,83.3167 +23.2500,77.4167 +18.6278,73.8131 +25.6100,85.1414 +30.9083,75.8486 +27.1800,78.0200 +19.2502,73.1602 +9.9197,78.1194 +22.8000,86.1833 +20.0000,73.7833 +28.4333,77.3167 +19.8800,75.3200 +22.2969,70.7984 +28.9900,77.7000 +23.1667,79.9333 +19.1800,72.9633 +23.7928,86.4350 +25.4550,81.8400 +25.3189,83.0128 +34.0911,74.8061 +31.6167,74.8500 +27.8800,78.0800 +19.3000,73.0667 +26.2150,78.1931 +21.2167,81.4333 +22.5900,88.3100 +23.3556,85.3347 +16.5167,80.6167 +30.7353,76.7911 +12.3086,76.6531 +21.2379,81.6337 +25.1800,75.8300 +28.3640,79.4150 +26.2918,73.0168 +11.0000,76.9667 +26.1500,91.7700 +26.1667,91.7667 +17.6833,75.9167 +10.8269,78.6928 +15.3600,75.1250 +31.3256,75.5792 +20.2644,85.8281 +19.3000,72.8500 +28.8418,78.7568 +16.7000,74.2333 +8.5000,76.8997 +29.9640,77.5460 +17.9756,79.6011 +11.6500,78.1667 +20.5500,74.5500 +9.9667,76.2833 +26.7611,83.3667 +13.9304,75.5600 +11.1075,77.3398 +16.3000,80.4500 +22.2492,84.8828 +12.8703,74.8806 +19.1500,77.3333 +20.4500,85.8667 +19.9500,79.3000 +30.3180,78.0290 +23.5500,87.3200 +23.6833,86.9667 +21.7650,72.1369 +20.9333,77.7500 +14.4333,79.9667 +26.4680,74.6390 +8.7289,77.7081 +28.0181,73.3169 +23.8333,91.2667 +23.1828,75.7772 +25.4486,78.5696 +19.2167,73.1500 +14.4667,75.9167 +32.7333,74.8500 +15.8667,74.5000 +17.3333,76.8333 +22.4700,70.0700 +20.9000,74.7833 +24.7500,85.0167 +21.0167,75.5667 +15.8222,78.0350 +24.5833,73.6833 From 640be4cd281701043ec19f8043866ec12008cf8f Mon Sep 17 00:00:00 2001 From: LakhanKumawat <55774240+Lakhankumawat@users.noreply.github.com> Date: Thu, 1 Apr 2021 13:09:49 +0530 Subject: [PATCH 09/10] Update README.md --- Gmplot-Track the Route/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gmplot-Track the Route/README.md b/Gmplot-Track the Route/README.md index 1ccdcf61c5..7372cfc3fe 100644 --- a/Gmplot-Track the Route/README.md +++ b/Gmplot-Track the Route/README.md @@ -33,7 +33,8 @@ _OR_ Just point the location on the map . 37.764028, -122.510347 # Outcome -Screenshot-40 +![Screenshot (41)](https://user-images.githubusercontent.com/55774240/113260040-6dadab00-92eb-11eb-97ef-ee2772e22a3f.png) + ## Author : [Lakhan Kumawat](https://github.com/Lakhankumawat) From 5484ec65da00eca4440b207895fd4c430f126a67 Mon Sep 17 00:00:00 2001 From: LakhanKumawat <55774240+Lakhankumawat@users.noreply.github.com> Date: Thu, 1 Apr 2021 17:09:28 +0530 Subject: [PATCH 10/10] Changes made --- Gmplot-Track the Route/README.md | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Gmplot-Track the Route/README.md b/Gmplot-Track the Route/README.md index 7372cfc3fe..1fbcf28dd8 100644 --- a/Gmplot-Track the Route/README.md +++ b/Gmplot-Track the Route/README.md @@ -18,19 +18,6 @@ _OR_ Just point the location on the map . | ------ | ------ | | `pip install gmplot` | [Gmplot/PyPI](https://pypi.org/project/gmplot/) | -# CSV File Data - | Latitude | Longitude | - | ------ | ------ | - 37.771269, -122.511015 - 37.773495, -122.464830 - 37.774797, -122.454538 - 37.771988, -122.454018 - 37.773646, -122.440979 - 37.772742, -122.440797 - 37.771096, -122.453889 - 37.768669, -122.453518 - 37.766227, -122.460213 - 37.764028, -122.510347 # Outcome ![Screenshot (41)](https://user-images.githubusercontent.com/55774240/113260040-6dadab00-92eb-11eb-97ef-ee2772e22a3f.png)