use haversine formula to aggregate the total distance in km