Rydberg excitations in Bose-Einstein condensates in quasi-one-dimensional potentials and optical lattices