We study rational expectations equilibrium problems and social optimum problems in infinite horizon spatial economies in the con- text of a Ramsey type capital accumulation problem with geographical spillovers. We identify sufficient local and global conditions for the emergence (or not) of optimal agglomeration, using techniques from monotone operator theory and spectral theory in infinite dimensional Hilbert spaces. Our analytical methods can be used to systematically study optimal potential agglomeration and clustering in dynamic economics.