Image copyright David Shukman Image caption Like other developing countries, Indonesia is wrestling with an acute plastic waste problem

A crisis of plastic waste in Indonesia has become so acute that the army has been called in to help.

Rivers and canals are clogged with dense masses of bottles, bags and other plastic packaging.

Officials say they are engaged in a "battle" against waste that accumulates as quickly as they clear it.

The commander of a military unit in the city of Bandung described it as "our biggest enemy".

Like many rapidly developing countries, Indonesia has become notorious for struggling to cope with mountains of rubbish.

A population boom has combined with an explosive spread of plastic containers and wrapping replacing natural biodegradable packaging such as banana leaves.

The result is that local authorities trying to provide rubbish collection have been unable to keep up with the dramatic expansion of waste generated.

And a longstanding culture of throwing rubbish into ditches and streams has meant that any attempt to clean up needs a massive shift in public opinion.

'Shocking sight'

In Bandung, Indonesia's third largest city, we witnessed the shocking sight of a concentration of plastic waste so thick that it looked like an iceberg and blocked a major tributary.

Soldiers deployed on a barge used nets to try to extract bags, Styrofoam food boxes and bottles, a seemingly futile task because all the time more plastic flowed their way from further upstream.

Image copyright David Shukman Image caption The concentrations were so thick they blocked a major tributary

Image copyright Kate Stephens Image caption Sending in the army was a drastic step, but it has made a difference

The senior official in charge, Dr Anang Sudarna, who heads the West Java Environmental Protection Agency, told me that the problem was "impossible to sort out without the highest authority".

That's why he took the drastic step of appealing to the Indonesian president to send in the army, and the move has made some difference, according to Dr Sudarna.

"The result is a little bit improved…but I am angry, I am sad, I am trying to think how best to solve this... the most difficult thing is the people's attitude and the political will."

Frontal assault

For Sergeant Sugito, commanding an army unit, the assignment was new and unusual and "not as easy as flipping your hand".

"My current enemy is not a combat enemy, what I am fighting very hard now is rubbish, it is our biggest enemy."

But he also said that plastic should be recognised as valuable - "for example, plastic cartons and drinking bottles can be separated from the other rubbish and sold", he said.

Encouraging people to see plastic as a resource is a key step towards finding a solution to the crisis.

Image copyright Kate Stephens Image caption For small amounts of money, residents are being encouraged to sort plastic waste for recycling

To encourage recycling, the authorities in the Bandung area are supporting initiatives in "eco-villages" where residents can bring old plastic items and earn small amounts of money in exchange.

The plastics are then divided by type. In one project we visited, two women patiently cut apart bottles and small water cups because separating the different kinds of polymers earns higher prices.

Officials are optimistic that word will spread that plastic has value - and raise awareness of the plastic waste problem - but they also admit privately that many residents are either uninterested or cannot see the point.

Meanwhile, on Bandung's only landfill site - which receives only a fraction of the waste the city produces - an unofficial form of recycling is under way.

Next generation

On a hillside buried in rubbish, amid an overwhelming stench in the tropical heat, 500 so-called "scavengers" search each new load of rubbish for plastic products.

When I asked one man, scrambling from the path of an excavator, what he was looking for, he reached into a bag and held up a plastic bottle.

The work is punishing but generates income which supports entire families living on the dump, and it also demonstrates that there is a market for recycled plastic and more could be done to serve it.

Image copyright Kate Stephens Image caption Investment is needed for public education on waste, activists argue

For one activist working to change attitudes, Mohamad Bijaksana Junerosano of Greeneration, the solution has to involve law enforcement, education and social awareness.

Investment was needed to teach children about waste and recycling, he said, but that had to be done in combination with improvements in public attitudes.

"If we educate the student, when they go outside the school and the ecosystem is still broken and people are littering everywhere, they are confused so it needs both sides, education and also law enforcement by society."

Monumental scale

A Dutch environmental scientist, Prof Ad Ragas of Radboud University, with long experience of Indonesia's plastic problem, told me he has detected an important shift in the authorities.

Two years ago, when he organised a workshop on plastic pollution in Bandung, "government officials didn't seem to care about it, they didn't see it as a really big problem".

By contrast, at another workshop held last month, "it's changed dramatically".

Social media, rapidly conveying images of choked waterways, had made a difference to people, he said.

"They immediately see that 'this is what my river look likes now and I'm doing that because I'm throwing all this plastic away' so they get feedback much quicker than they used to."

Image copyright David Shukman Image caption At the city dump, gathering plastic waste provides income for whole families

Image copyright Kate Stephens Image caption The challenge is so vast, different army units are needed to deal with the problem

But the challenge is not only monumental in scale; it is also constant.

The soldiers we filmed had planned to load the plastic onto trucks but because the vehicles never arrived they decided on a different course of action: to use a digger to push the waste downstream.

I asked the sergeant what would happen to it. It was up to another unit to collect, he said. It became someone else's problem.

Near the coast, just outside the capital Jakarta, we came across a canal that was totally blocked with plastic. Local residents complained that whenever they tried to clear it, more arrived from upstream, as in Bandung.

Most apocalyptic of all was the scene at a fishing village on the coast itself. The mud of the shoreline was completely hidden by a thick layer of plastic waste stretching over hundreds of metres.

On a walkway crossing over the sea of plastic was a small girl playing with a balloon. By the time Indonesia's plastic nightmare is sorted, she may well have grown up.

Follow David on Twitter.