  Many real-world problems require to optimise trajectories under constraints.
Classical approaches are based on optimal control methods but require an exact
knowledge of the underlying dynamics, which could be challenging or even out of
reach. In this paper, we leverage data-driven approaches to design a new
end-to-end framework which is dynamics-free for optimised and realistic
trajectories. We first decompose the trajectories on function basis, trading
the initial infinite dimension problem on a multivariate functional space for a
parameter optimisation problem. A maximum \emph{a posteriori} approach which
incorporates information from data is used to obtain a new optimisation problem
which is regularised. The penalised term focuses the search on a region
centered on data and includes estimated linear constraints in the problem. We
apply our data-driven approach to two settings in aeronautics and sailing
routes optimisation, yielding commanding results. The developed approach has
been implemented in the Python library PyRotor.
