fix
parent
60562643b3
commit
fa034437d8
|
@ -171,10 +171,10 @@ def calcula_distancias_parada(redis_id, parada_id):
|
|||
|
||||
def estima_llegada(parada_distance, expedicion):
|
||||
ts = int(time.time())
|
||||
data_keys = ['trip_traveled', 'ppu', 'trip_lat', 'trip_lon', 'trip_pos', 'ts']
|
||||
data_keys = ['trip_traveled', 'bus_id', 'trip_lat', 'trip_lon', 'trip_pos', 'ts']
|
||||
trip_info = dict(zip(data_keys, expedicion))
|
||||
trip_info['bus_id'] = xxhash.xxh32(data_keys['ppu'], seed=data_keys['id_linea']).hexdigest()
|
||||
|
||||
trip_info['bus_id'] = xxhash.xxh32(trip_info['bus_id'], seed=parada_distance).hexdigest()
|
||||
|
||||
trip_info['drift'] = int(trip_info['ts']) - ts
|
||||
trip_info['trip_distance'] = parada_distance - int(trip_info['trip_traveled'])
|
||||
estimator = int(trip_info['trip_distance'] / 5) # 18 Km/h promedio -> 5 m/s
|
||||
|
|
Loading…
Reference in New Issue