determine start/end of a trip assuming waypoints come unordered