We study the behaviour of shallow water waves propagating over bathymetry that varies periodically in one direction and is constant in the other. Plane waves travelling along the constant direction are known to evolve into solitary waves, due to an effective dispersion. We apply multiple-scale perturbation theory to derive an effective constant-coefficient system of equations, showing that the transversely averaged wave approximately satisfies a Boussinesq-type equation, while the lateral variation in the wave is related to certain integral functions of the bathymetry. Thus the homogenized equations not only accurately describe these waves but also predict their full two-dimensional shape in some detail. Numerical experiments confirm the good agreement between the effective equations and the variable-bathymetry shallow water equations.