We show that investments in public goods change the optimal land use in their vicinity, leading to additional welfare benefits. This occurs through two sorting mechanisms. First, availability of public goods leads to higher population densities. Second, population groups sort according to their preferences for public goods. We develop a structural spatial general equilibrium model that accounts for these effects. The model is estimated using data on transport infrastructure, commuting behaviour, land use and land rents for some 3000 ZIP-codes in the Netherlands and for three levels of education. Welfare benefits of investments in public transport infrastructure are shown to differ sharply by workers’ educational attainment. Welfare gains from changes in land use account for up to 30% of the total benefits of a transport investment.