def export_kml(self, filename, dataname, x_name, y_name): kml = kmlclass() kml.begin(filename, dataname, 'Description', 0.1) kml.trksegbegin('', '', 'red', 'absolute') for i in range(len(self.df[x_name])): kml.trkpt(self.df[x_name][i], self.df[y_name][i], 0.0) kml.trksegend() kml.end()
def export_kml_data(self, filename, dataname, x_data, y_data): kml = kmlclass() kml.begin(filename, dataname, 'Description', 0.1) kml.trksegbegin('', '', 'red', 'absolute') for i in range(len(x_data)): kml.trkpt(x_data[i], y_data[i], 0.0) kml.trksegend() kml.end()
def export_kml_path(self, name): print("[Path planner]: "+"Exporting") # width: defines the line width, use e.g. 0.1 - 1.0 kml = kmlclass() name = "../"+name kml.begin(name+'.kml', 'Example', 'Example on the use of kmlclass', 0.1) # color: use 'red' or 'green' or 'blue' or 'cyan' or 'yellow' or 'grey' # altitude: use 'absolute' or 'relativeToGround' kml.trksegbegin('', '', 'blue', 'absolute') for i in self.path: kml.trkpt(i.lat, i.lon, 0.0) kml.trksegend() kml.end()
nmea.import_file(read_file) MSL = [] NrOfSatellites = [] GNSSAccuracy = [] timeSplitted = [] longitude = [] lattitude = [] timeSplitted = [] time_in_seconds = [] start_time = 0.0 temp_time = 0.0 splitedcord = [] tempcord = 0 kml = kmlclass() kml.begin('DroneTrack.kml', 'Drone track', 'Creating of the track of the drone', 0.1) kml.trksegbegin('', '', 'red', 'absolute') for i in range(len(nmea.data) - 1): #len(nmea.data)-1 if (nmea.data[i][0] != '$GPGGA'): continue if (len(nmea.data[i][1]) < 1 or len(nmea.data[i][2]) < 1): continue for t in str(nmea.data[i][1]): if t != ".": timeSplitted.append(float(t)) temp_time = ((timeSplitted[0] * 10) + (timeSplitted[1])) * 3600 temp_time += ((timeSplitted[2] * 10) + (timeSplitted[3])) * 60