From d245e3f2f82eb28e0915cfac03e1995a4926e66d Mon Sep 17 00:00:00 2001 From: Florian Bezannier Date: Wed, 5 May 2021 09:20:53 +0200 Subject: [PATCH] fix lat and long invert --- trip.py | 4 ++-- web/figures.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/trip.py b/trip.py index 20cefbe..eb41019 100644 --- a/trip.py +++ b/trip.py @@ -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 diff --git a/web/figures.py b/web/figures.py index 7b079fd..46d052a 100644 --- a/web/figures.py +++ b/web/figures.py @@ -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)