1 '''
2 Created on 20.03.2017
3
4 @author: johanneskinzig
5
6 @description: Use geoplotlib to plot the flight on a map
7 '''
8 from DroneDataConversion import DroneDataConversion
9
11 """Plot flight track on a map - plot as a static track"""
13 '''
14 Get instances and prepare vars
15 '''
16
17
18 flightDataProvider = DroneDataConversion.BebopFlightDataManager(pud_file)
19
20 self.sec, self.lat, self.lon, self.alt, self.spe, self.bat = flightDataProvider.passFlightData()
21
23 '''Put data into dictionary; then geoplotlib is able to draw it onto the map'''
24 track_dataframe = {"lat" : self.lat, "lon" : self.lon, "name" : self.sec}
25 return track_dataframe
26
28 '''Plot the track onto the map - engine is based on pyglet - right now it is just a point cloud'''
29 import geoplotlib
30 geoplotlib.dot(self.prepareDataFrame())
31 geoplotlib.show()
32
33
35 '''Do the same like PlotTrackOnMap but do it as a separate process. Recommended when calling the method from another GUI library.'''
36 from multiprocessing import Process
37 nproc = Process(target=self.plotTrackOnMap())
38 nproc.start()
39
40
41 '''Replay/Refly flight on map'''
42
43
44 if __name__ == '__main__':
45 print "Init Done"
46 myflight = PlotGPSTrack("../../DroneDataConversion/DroneDataFiles/BebopTenthFlight_2016_12_10.json")
47 myflight.plotTrackOnMap()
48