Geographical constraints and educational attainment