Using new data on citations to university patents and scientific publications, and measures of distance based on Google maps, we study how geography affects university knowledge diffusion. We show that knowledge flows from patents are localized in two respects: they decline sharply with distance up to about 100 miles, and they are strongly constrained by state borders, controlling for distance. While distance also constrains knowledge spillovers from publications, the state border does not. We investigate how the strength of the state border effect varies with university and state characteristics. It is larger for patents from public, as compared to private, universities and this is partly explained by the local development policies of universities. The border effect is larger in states with stronger non-compete laws that affect intra-state labor mobility, and those with greater reliance on in-state educated scientists and engineers. We confirm the impact of non-compete statutes by studying a policy reform in Michigan that introduced such restrictions.