fix lat and long invert

This commit is contained in:
Florian Bezannier
2021-05-05 09:20:53 +02:00
parent c0e2c23742
commit d245e3f2f8
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -183,7 +183,7 @@ class Trips(list):
if trip.distance > 0:
trip.start_at = start["Timestamp"]
trip.end_at = end["Timestamp"]
trip.add_points(end["longitude"], end["latitude"])
trip.add_points(end["latitude"], end["longitude"])
if end["temperature"] is not None and start["temperature"] is not None:
trip.add_temperature(end["temperature"])
trip.duration = (end["Timestamp"] - start["Timestamp"]).total_seconds() / 3600
@@ -205,7 +205,7 @@ class Trips(list):
start = next_el
trip = Trip()
else:
trip.add_points(end["longitude"], end["latitude"])
trip.add_points(end["latitude"], end["longitude"])
end = next_el
trips_by_vin[vin] = trips
return trips_by_vin
+2 -2
View File
@@ -78,8 +78,8 @@ def get_figures(trips: Trips, charging: List[dict]):
names = []
for trip in trips:
for points in trip.positions:
lats = np.append(lats, points.longitude)
lons = np.append(lons, points.latitude)
lats = np.append(lats, points.latitude)
lons = np.append(lons, points.longitude)
names = np.append(names, [str(trip.start_at)])
lats = np.append(lats, None)
lons = np.append(lons, None)