Touch up distance API

This commit is contained in:
Danila Fedorin 2020-05-12 17:37:48 -07:00
parent 4448de1288
commit f79748c113

View File

@ -48,8 +48,9 @@ def collars_distance():
distance_kilometers = 0
coords_pairs = list(map(lambda e : (e.longitude, e.latitude), coords))
if len(coord_pairs) < 1: continue
coord_last = coords_pairs.pop()
coord_last = coords_pairs.pop(0)
for coord in coords_pairs:
distance_kilometers += geopy.distance.VincentyDistance(coord_last,coord).km
coord_last = coord