This work provides a rigorous treatment concerning the formation of rational expectations equilibria in a general class of spatial economic models under the effect of externalities, using techniques from calculus of variations and optimal control. Using detailed estimates for a parametric optimisation problem, the existence of rational expectations equilibria is proved via a fixed-point theorem, and they are characterised in terms of a nonlocal Euler-Lagrange equation. The study of the individual optimisation problem, formulated according to Ramsey's model, is performed via a convex relaxation to the space of BV capital paths and measure-valued consumptions, and allows to obtain existence, uniqueness, regularity and stability properties for the optimisers in a rigorous and original way.