IT IS the peak of the rainy season in Indonesia: good for farmers, but not so welcome for the 9m or so citizens of Jakarta. They hope to dodge the “five-year curse”. In 2007 flooding inundated nearly three-fifths of the capital, killing 52 people, displacing some 450,000 more and costing nearly $1 billion. Five years before that floodwaters killed about 60 residents and forced 365,000 from their homes.

Belatedly, the city government has agreed on a plan to dredge ten of Jakarta's 13 rivers and one of its old canals. Four giant reservoirs are also to be dredged, in order to restore their full holding capacities. The capital lies in a low, flat basin less than ten metres above the nearby Java Sea. It is naturally prone to flooding, yet its waterways have not been properly cleared for decades. Silt has accumulated, and a fifth of the city's daily waste gets tossed into rivers and canals. Had the city cared better for its waterways over the years, experts claim, the amount of flooding would have been cut by more than half.

Getting the clean-up plans in place, says an official from the World Bank, which is co-funding the project, has been like pulling teeth. The urgency is compounded by the fact that Jakarta is sinking. A recent World Bank reports says that land subsidence from compaction (from new skyscrapers, for instance) and increased groundwater extraction (for a growing population) mean that Jakarta is sinking ten times faster than the Java Sea is rising because of climate change.

All across Asia, megacities face similar problems. A report published this week by the Asian Development Bank (ADB) looks at links between expected climate change and migration. In 2010-11 alone 42m people in Asia were displaced by “extreme” weather. Most attention tends to focus on inhabitants of low-lying islands in the Indian and Pacific Oceans—the Maldives, Tuvalu and Kiribati, say—and coastal plains, notably in Bangladesh. Yet the megacities are where climate migrants are expected to move to, and they are often in the coastal areas most at risk from rising sea levels. In East Asia such cities include Guangzhou, Seoul and Nagoya. In South Asia Bangladesh's capital, Dhaka, is vulnerable, as are Kolkata and Chennai. Substantial parts of Mumbai, a city of around 20m people, are already below sea level.

In South-East Asia Bangkok, Manila and Ho Chi Minh City are all low-lying urban areas, yet like Jakarta they have all taken too long to react to the threat of increased flooding. Last year heavy rainfall overwhelmed the Chao Phraya river system, on which Bangkok sits, and the Thai capital only just avoided a catastrophe. As it was, hundreds died, and the World Bank estimates the floods cost Thailand $46 billion in economic damage.

Equally, last year's flooding of the Mekong river, which devastated large parts of Cambodia, should serve as a warning to the region, says David McCauley, head of the ADB's climate-change programme. Most at risk is Ho Chi Minh City on the Saigon river, just north of the Mekong. The city has a population of 6.3m and growing, and accounts for over a fifth of Vietnam's economy. The ADB predicts disaster if the city's defences are not drastically improved. Projecting to 2050, it warns that seven-tenths of the city could be affected in cases of “extreme” flooding.

Belatedly, the city government is looking at a range of new flood defences, including dykes. Manila, capital of the Philippines, is doing the same. Yet experts agree that physical flood defences will only go so far. Just as important is a willingness to limit or relocate urban and industrial expansion. In Ho Chi Minh City, the ADB authors argue that “urbanisation has contributed significantly to increasing temperature, rainfall, and flooding over the last two decades”. Concreting over flood plains does not help. Governments could do much more to encourage businesses and residents, including slum-dwelling migrants, to settle in less vulnerable areas.

This will require changes in zoning and planning, maybe at a short-term cost to economic growth. Yet the experience of Thailand last year illustrates the greater cost of doing nothing. The huge industrial estates just north of Bangkok sit on land that was once heavily cultivated for rice, precisely because the land floods regularly. The factories were swamped in the flooding. As a result, at the end of 2011 Thailand suffered its biggest quarterly contraction in GDP (9% year-on-year) since the Asian financial crisis of 1997-98.

Some companies are now contemplating a move to higher ground. That will add to their costs, but could spare them next time. Thailand's government is urgently reviewing its policies too. If that provokes the region's other vulnerable cities to do the same, it would be no bad thing.