How to infer a flight plan from a trajectory?