Trajectories for the Optimal Collection of Information