Nutrients: Nitrogen and phosphorus from livestock urine and fertilizer

Bacteria: E. coli from livestock excrement

DairyNZ, an organisation funded by New Zealand's 10,000 dairy farmers, implemented a plan entitled the 'Sustainable Dairying: Water Accord' in 2013 which it hopes will be the blueprint for protecting all Kiwi waterways on farmland.

DairyNZ say its farmers have spent over a billion dollars protecting waterways from contaminants - so what exactly have they spent this money on?

Building modern effluent systems

Fencing off waterways from livestock

Planting riparian systems to protect waterways from sediment, nitrogen, phosphorus and heat from the sun

Brian Gallagher has run a dairy farm in Patumahoe, south of Auckland, for 25 years.

He and his wife Pirkko didn't wait for the water accord to act - they began protecting their farm's waterways by fencing them off from cows two decades ago.

"It was fenced primarily because I didn't want any stock in a waterway. We have to use that water as a resource, as do the people downstream," says Mr Gallagher.

He says he has spent a quarter of a million dollars to make his farm more environmentally friendly - and most of that money was used to build a high-tech effluent system that he can basically control from his mobile phone, even when he is off the property.

"It's paramount that not one drop of effluent gets into a waterway, so that the next generation coming through can go and fish in the Manukau Harbour, for example, or the Kaipara," says Mr Gallagher.

"It's really, really important that they can go water skiing in the Waikato River like I did when I was a kid."

Obviously, Mr Gallagher is an environmentally conscious farmer, but he can only protect one side of the waterway that borders his property. His neighbour, a beef farmer who doesn't fall under DairyNZ's water accord, does not.

DairyNZ say up to 98 percent of its farmers have protected waterways with fencing. (DairyNZ)

"As a farmer we've a responsibility to look after the environment," says Mr Gallagher.

"If there are any farmers in New Zealand that are flouting the laws, whether if that's internally through Fonterra or Auckland Council in our case, or any council around New Zealand, my personal opinion is that they should be prosecuted.

"There should be zero tolerance is far as I'm concerned."

These are strong words from a proud farmer, and they perhaps differ from the view that some Kiwis have of dairy farmers making millions with little regards to the health of the rivers running through their property.

When will the water accord bear fruit?

DairyNZ water scientist Dr Tom Stephens has played a major role in implementing and improving the water accord, including developing a world-first online riparian planting programme. The riparian area is the land immediately adjacent to a waterway.

"It promotes gold standard riparian management that allows you to map out your waterways, it then prompts you to do stuff to them like create a 3m set-back," says Dr Stephens.

Riparian planting is one of the most useful measures any farmer - dairy or otherwise - can undertake to protect waterways on their land. It absorbs dangerous nutrients from cow urine that produces nitrogen, and phosphorus that can come from fertiliser.

Riparian planting also helps keep the ground and soil together, and can stop invasive sediment from entering the water.

"Planting is all about reinforcing those banks to prevent them from slipping, but it's also about intercepting all that run off, all that flow that's coming off the paddocks ," says Dr Stephens.

Over 1000 dairy farmers are now using his riparian programme, but Dr Stephens says any significant improvements to water health will take time, largely because of New Zealand's immense deforestation and sediment issues.

"We're only four years in, it is a huge undertaking," he says.

"But it's going to take us years to see those effects actually come through, because sediment issues in particular are really long lived. Until they're flushed out of the environment, those sediment grains will still occupy the bed of the river, and if they do so you can't get the insect populations living in those gravels."

Insect populations are crucial

Without insect populations there's no food source for New Zealand's fish species, native or introduced, such as trout or salmon. This has been especially noticeable in some of Canterbury's rivers such as the Rangitata near Ashburton - where the fish stock has all but disappeared.

Some angry anglers are blaming the agricultural industries for using too much water from the rivers on the Canterbury plains to irrigate their businesses - but in some other New Zealand rivers such as the Waikato there is another problem - too much food for the insects to feed on.

"The majority of algae that we see in our rivers aren't toxic, we're talking about the base of the food web," says Dr Stephens.

"And the problem that we have with them in certain rivers and lakes is that there's just too much of them, and too much food results in too little oxygen, essentially, in this environment."

Farming practices are constantly changing

Adrian Brocksopp is a project manager for DairyNZ who grew up on a farm in Leicestershire in the UK.

He says Kiwi dairy farmers are leading the world in protecting their waterways, but every farmer's situation is unique, depending on the amount of livestock they have and the slope of their land.

"We know the solutions just aren't going to be silver bullets, it's going to be a combination of a lot of things farmers can do, and it's not going to be one size fits all. We need solutions that are different for all farm situations," says Mr Brocksopp.

"Often, change takes time. Time, both financially, and time for skill sets to change on a farm.

"How we farm now is different to how we farmed ten years ago because the challenges are changing all the time, and we now learn more all the time."

Changing what the cows actually eat

Dr Stephens says DairyNZ farmers have begun feeding their cows different types of feed that can reduce the nitrogen in their urine.

"What we're trying to do is reduce the amount of nitrogen that we're losing, so that's feeding stock better sources of energy that have lower protein content because protein is rich in nitrogen," he says.

What a cow eats can change how much nitrogen it produces. (DairyNZ)

"The majority of protein a cow consumes, it's not actually converted into milk, so we're trying to reduce that."

DairyNZ scientists are also experimenting with different types of grasses that can better absorb nitrogen before it seeps into the soil.

Is the dairy industry going far enough?

There is still criticism from some fresh water scientists that DairyNZ's water accord doesn't go far enough.

Dr Kevin Simon teaches freshwater ecology at Auckland University. He says while the dairy industry is taking steps to fix the water pollution problem, it should be being done on a much larger scale.

"The fencing of waterways, replanting what we call riparian plants beside the streams is fantastic, but it hasn't happened on a big enough scale to work very well," says Dr Simon.

"The problem is a big scale problem that occurs over big chunks of the landscape, so we need solutions that are deployed on that same scale.

"I think they're also hard choices, especially the nitrogen issue.

"At the end of the day we're going to have to use less fertiliser more efficiently if we want to solve that problem. So it's a combination of some hard choices mixed with some things we know that can work, but try and do that on a bigger scale."

While some rivers are in decline - many are actually improving

NIWA's chief scientist of freshwater and estuaries Dr John Quinn published a paper in 2016 on the state and trends of nutrients such as nitrogen and phosphorus in Kiwi rivers, using data from around 900 sites around the country.

He says 500 of those sites tended to show signs of improvement with regards to phosphorus, ammonia and visual clarity - while up to 50 percent of sites showed improving trends in the E. coli, the bacteria harmful to humans caused by livestock faeces.

"I don't know if we are in a state where things are turning to custard rapidly, but there are signs of a number of attributes that are actually getting better, although with nitrate, things seem to generally be getting worse," he says.

"With nitrogen it tends to go through the ground water system, whereas with sediment and bugs - the things that make you sick, the pathogens and phosphorus - they tend to travel in surface run-off pathways, whereas the nitrogen tends to leech down through the ground water.

"Because it comes out through the ground water, the time it takes to get into the streams is determined by the residence time of the ground waters, and in some parts of the country those residence times are very short - a year or so, even shorter.

"But in others, areas have 50 to 100 years residence time, so of course it takes quite a while.

"What we're seeing now is actually farming practices from decades ago in those places, and other places it's much more."

Tomorrow, in part three of Newshub's special investigation into the health of New Zealand's waterways, we'll examine the effects of climate change, and whether or not we've reached a tipping point for overall river health decline in New Zealand.