WILL Rio de Janeiro be ready to host the Olympics in 2016? The scale of the challenge is phenomenal. On top of the usual demands on transport and accommodation posed by big sporting events, this one is being held in a city where much housing is perched precariously, without foundations, on the sides of steep hills, and where crime rates are astronomical. The example of the Pan American Games, which Rio hosted in 2007, hardly reassures: the preparations went wildly over budget even though planned miles of new roads, as well as metro and train lines never materialised. Nor was the stinking Guanabara Bay cleaned up as promised.

Air transport, in particular, is a serious worry. Both of Rio’s airports, the domestic Santos Dumont and the international Galeão, are already operating above capacity. The Brazilian market for flying is expected to grow by around 10% a year annually for at least the next three or four years. And then there are the droves of visitors who will flock to the Games themselves. At a conference in November Giovanni Bisignani, the chief executive of the International Air Transport Association, described Brazil’s air transport infrastructure as a “growing disaster” and said that if the country was to avoid a “national embarrassment” it needed to move immediately. “But I don’t see progress and the clock is ticking,” he added.

And yet some things are going right. The first is the success of the city’s “Pacification Police” Units, or UPPs—new round-the-clock community-style policing units that are being placed in favelas, or shantytowns. The policy was already proceeding, though slowly, when a sudden acceleration caused by a spate of carjackings in November forced the pace. The Complexo do Alemão, a big conglomeration of favelas, was pacified much earlier than expected—and is being held, rather, it must be said, against expectations. Since then both violent crime and property crime have fallen in Rio, as criminals have been deprived of some of their most convenient boltholes.

And the city is finally putting together an effective procedure for dealing with emergencies. In April more than 100 people were killed by mudslides after 28 cm (11 inches) of rain fell in just 24 hours. The response was uncoordinated and chaotic. “The mayor, Eduardo Paes, has identified emergency response as the most urgent problem facing the city in the run-up to the Olympics,” explains Guruduth Banaver of IBM. The company has just signed a big deal with Rio to supply this lack.

Mr Banaver is the chief technology officer for IBM’s “Smarter Cities” initiative, a package of consultancy, software and monitoring technology that creates an evolving “system of systems” that allows a quicker and more effective response to unpredictable events. “I’ve interviewed people who were there at the time, and watched the videos, and it’s clear that no one knew what was going on. Mobile phone networks were still working, and the TV stations broadcast emergency numbers, but the phone lines were overwhelmed.”

Mr Paes realised the one place he could get information on what was happening was from the city’s traffic surveillance cameras, and took himself in person to the centre where they were monitored. From a youth spent in Connecticut he remembered “snow days”, and declared a “rain day” with everyone who could stay indoors asked to do so. “That simple decision on its own is credited with saving lives,” says Mr Banaver.

If the rainy season is equally hard on Rio in 2011, the city will be better prepared. It now has a fine-grained weather forecasting system that will allow it to send people, supplies and vehicles to danger areas and put hospitals and officials on alert before anything happens. Staff are being trained to provide information on needs and resources via a dedicated phone number once the worst actually does come to pass. But it isn’t all about floods, or even crisis management, emphasises Mr Banavar: the point is to integrate processes and data right across the city’s transportation, public works and utilities. Maybe the Olympics will leave Rio a legacy worth having, after all.