forked from M4ndU/Fodogu-dji-dat-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
showFlight.py
37 lines (31 loc) · 853 Bytes
/
showFlight.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# python3
# Subin Jo
# 2022.12.16
import pandas as pd
import folium, io
def getGPS(in_csv):
"""
<TestCode>
usecols = ['GPS(0):Lat', 'GPS(0):Long']
cf = pd.read_csv('SampleData/inspireFLY009.csv', usecols=usecols)
lines = cf[['GPS(0):Lat', 'GPS(0):Long']].values[:].tolist()"""
usecols = ['latitude', 'longitude']
cf = pd.read_csv(in_csv, usecols=usecols)
lines = cf[['latitude', 'longitude']].values[:].tolist()
print(lines)
return lines
def mappingGPS(lines):
center = lines[0]
m = folium.Map(location=center, zoom_start=20)
folium.PolyLine(locations=lines).add_to(m)
m.add_child(folium.LatLngPopup())
data = io.BytesIO()
m.save(data, close_file=False)
#m.show_in_browser()
return data
"""
<TestCode>
if __name__ == "__main__":
lines = getGPS()
mappingGPS(lines)
"""