mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 09:26:16 +00:00
fix lat and long invert
This commit is contained in:
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user