“WE PAY our money and you see how it looks,” says Aggrey Batwala, leaning out of his minibus in Kampala’s muddy taxi park. Shared taxis used to pay city authorities 120,000 shillings ($32) a month for the right to ferry commuters into the Ugandan capital. But in September indignant drivers stopped coughing up. They later complained to the president, who ordered that the levy be halved. The city appealed against his decision and the drivers still aren’t paying. The stand-off could cost it 21bn shillings this year.

Kampala shows why African cities struggle to raise revenues, squeezed as they are between poor citizens and overweening central governments. But it also proves that doing better is possible. In 2010-11 the city collected just 30bn shillings (see chart). Last year it raised 89bn shillings, about a third of its non-aid budget (the rest comes from central government). Its experience offers lessons for African cities, which will triple in size by 2050. They need roads, drains and lights. Yet many look to central governments for funds rather than seek ways to raise their own.

The change in Kampala began in 2011 with the creation of the Kampala Capital City Authority, a group of unelected technocrats which assumed most of the powers of the old city council. It took over a city with too many official bank accounts. Revenue collection was farmed out to middlemen who beat money out of taxi drivers, handing only a fraction to public coffers. The first step was sorting out administration and compliance. Collection was brought in-house. A new system allowed citizens to pay on their mobile phones.

Early gains came from taxi fees and business licences. They are predictably unpopular. Betty Ssuubi, who sells clothes downtown, says the licence for which she pays 210,000 shillings annually is too high. “Just look at this business,” she says, her shop barely bigger than a wardrobe.

Next came a drive to collect more property taxes. These should fall more heavily on the rich, rise as better services push up house prices and be harder to dodge. But the most recent valuation was in 2005, so new malls and office blocks were not on the register. That is not unusual in Africa. Nairobi has not updated its roll since 1982.

Valuers are now traipsing around Kampala, registering properties on tablet computers. In the business district they counted 16,000 buildings, doubling the size of the roll and tripling revenues from the area. Fred Andema, the city’s chief taxman, hopes to raise 50bn shillings a year from property once the valuation exercise is complete. But he also estimates that he loses 20bn shillings because national law exempts owners who occupy their properties from paying the tax.

That suggests the third and, perhaps, most important step: better policies. Often national politicians get in the way. Consider borrowing, which might benefit some cities (though not all). Kampala secured its first credit rating in 2015, but has not issued a bond because of a central-government cap on city debts. That year Senegal’s government forced Dakar to abandon a bond just two days before the planned issue. Civil servants cited regulations; cynics noted the mayor’s rivalry with the president.

Politics is not always a hindrance. Opposition governors in Lagos see tax reform as a way to transform the city and build their base. In Kampala democracy has been sidestepped. Jennifer Musisi, the city’s top technocrat, says that gives her “more freedom to do what is right”.

Ms Musisi points to better services and smoother roads. But the scale of the city’s problems still dwarfs the available resources. And her tough approach has more admirers on the affluent hillsides than in the slums between them. “It’s not fair,” says John Dungu, a shopkeeper. When it rains, he notes, the valleys still flood.