An 11-kilometre (seven-mile) system of drainage canals and water retention basins now snakes from the beach deep into boggy neighbourhoods.