Photos.com via Getty Images An aerial view of Fort McMurray, Alta.

MONTREAL ― Canada is home to some of the world’s least affordable housing markets ― and to the single most affordable one in a global ranking of more than 300 cities. Fort McMurray, Alta., home of the oilsands, ranked as the number one most affordable housing market in the 2020 edition of Demographia’s annual survey, up from fourth place last year. It takes just 1.8 times the median income in the city to afford a median home ― a reflection of both the high incomes made in the oilsands and the slump in Prairie cities’ housing markets since oil prices crashed starting in 2014. The market has been further depressed by rising insurance costs in the wake of the 2016 wildfire. Watch: 3 trends you can expect from Canada’s housing market in 2020. Story continues below.

Compare that to Vancouver, where it takes 12.6 times the median income to afford a home. The city ranked, once again, as the second-least affordable market in the survey, 308th out of 309 cities. Only Hong Kong, with a price-to-income ratio of 20.9, fared worse. Besides Canada, the study looks at Australia, Hong Kong, Ireland, Japan, New Zealand, Singapore, the U.S. and the U.K. The most notable change for Canada involves Toronto and Hamilton, Ont., which have dropped precipitously on the affordability rankings. Toronto ranked as the seventh-least affordable city in the survey, from 15th a year earlier. Since the previous year’s survey, it has become less affordable than London, San Francisco and Silicon Valley (San Jose, Calif.), among others. Nearby Hamilton, which has seen house prices jump as Torontonians headed to the city in search of more affordable homes, ranks as the 30th least affordable city this year. It ranked 90th just five years ago. Demographia noted that Toronto’s rising house prices have spread to most major southern Ontario cities, eroding affordability in all of them.

Demographia This chart from Demographia shows that, between 2009 and 2019, the ratio of house prices to income has increased sharply in cities near Toronto, namely Barrie, Hamilton, Kitchener-Waterloo, London, Peterborough and St. Catharines-Niagara.

Demographia names Canada ― along with the U.S., Australia and New Zealand ― as countries where, in some cities, “middle-income households have been largely priced out of the median price housing by spiraling cost increases.” But that’s not the case across the whole country. The study notes that Canada and the U.S. are the countries with the most variation in house prices, with cities ranking all over the affordability ranking. For Canada as a whole, it takes 4.4 times the median income to buy a house, making it the second most affordable market after the U.S., at 3.9 times. Housing affordability improved in Canada for much of 2019, thanks to slow or stagnant price growth in the wake of the mortgage stress test and foreign buyers’ taxes in British Columbia and Ontario.