The shallow water equations (SWE) are a widely used model for the propagation of surface waves on the oceans. We consider the problem of optimally determining the initial conditions for the one-dimensional SWE in an unbounded domain from a small set of observations of the sea surface height. In the linear case we prove a theorem that gives sufficient conditions for convergence to the true initial conditions. At least two observation points must be used and at least one pair of observation points must be spaced more closely than half the effective minimum wavelength of the energy spectrum of the initial conditions. This result also applies to the linear wave equation. Our analysis is confirmed by numerical experiments for both the linear and nonlinear SWE data assimilation problems. These results show that convergence rates improve with increasing numbers of observation points and that at least three observation points are required for the practically useful results. Better results are obtained for the nonlinear equations provided more than two observation points are used. This paper is a first step in understanding the conditions for observability of the SWE for small numbers of observation points in more physically realistic settings.