diff --git a/Gmplot-Track the Route/LatLong.csv b/Gmplot-Track the Route/LatLong.csv new file mode 100644 index 0000000000..56a655bc93 --- /dev/null +++ b/Gmplot-Track the Route/LatLong.csv @@ -0,0 +1,100 @@ +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 diff --git a/Gmplot-Track the Route/README.md b/Gmplot-Track the Route/README.md new file mode 100644 index 0000000000..1fbcf28dd8 --- /dev/null +++ b/Gmplot-Track the Route/README.md @@ -0,0 +1,28 @@ +# 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/) | + + +# Outcome +![Screenshot (41)](https://user-images.githubusercontent.com/55774240/113260040-6dadab00-92eb-11eb-97ef-ee2772e22a3f.png) + + +## 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..225de8f50a --- /dev/null +++ b/Gmplot-Track the Route/main.py @@ -0,0 +1,38 @@ +import csv +from gmplot import gmplot #importing + +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 + for row in reader: + lat=float(row[0]) + long=float(row[1]) + + if k==0: + gmap.marker(lat, long, 'green') + k=1 + else: + gmap.marker(lat,long,'blue') + k=0 + +gmap.marker(lat,long,'red') +print("Done! Check file Output.html") +gmap.draw("Output.html")