Download and Fly: An Online Solution for the UAV 3D Trajectory Planning Problem in Smart Cities