China's fast growing middle classes demanded milk and New Zealand seemed to have inexhaustible supplies of water and grass-growing land to feed that demand.

Some thought it could never end, but it has, and not for the same demand and cost reasons that throttled Australia's iron ore investment boom.

Demand from China for New Zealand's milk powder has slowed slightly, contributing to a 41 per cent fall in milk powder prices this year. The bigger driver in a NZ$4 billion fall in forecast dairy incomes this year has come from a surge in milk supply in Europe and the United States in response to record-high prices last year.

However, the longer-term headwinds for the dairy boom are closer to home, thanks to an increasingly intense and often political debate about water quality that is leading to tougher regulatory limits on dairying.

Reserve Bank concerns about high levels of dairy debt and the increasing profitability of sheep and beef are factors too, but it is the water quality debate that is now dominant.

Economists and industry leaders acknowledge the rapid conversions of sheep and beef farms and forests to dairy farms over the last decade are likely to slow in the years ahead as regional councils set tougher limits on water quality that force farmers to change their methods and limit the intensity of dairying.

ANZ Rural Economist Con Williams expects the 5.5-6 per cent per year average production growth seen over the last 6 years to slow to 4 per cent in coming years as the number of conversions drops to less than a half what it has been. He sees on-farm productivity growth continuing around 3 per cent, but conversion-fed growth is likely to drop to around 1 per cent from 2.5-3 per cent.

Farmers will have to find new ways to increase production, rather than simply converting sheep farms or pine forests to dairy farms, or using feed supplements to increase stock rates.

"The more innovative people are already looking at different options," Williams says.

Outgoing Federated Farmers President Bruce Wills was even blunter in a recent television interview.

"I think the dairy boom is coming to an end. We're seeing better profitability at the moment in sheep and cattle. We've got these environmental issues, which are acting as a bit of a head-wind to the dairy sector," Wills said.

"We've got a dairy sector that’s extraordinarily indebted," he added.

The concerns about high levels of dairy debt have been around since 2008, but it is the emerging environmental concerns that are beginning to drag on the sector.

It's all about cow urine and nitrogen.

When a cow pees in a paddock that urine patch can contain the equivalent of up to 1,000 kg/ha of nitrogen fertilizer. That's much more nitrogen than the grass and soil can process, which leads to nitrates leaching through the soil and into waterways. Increased nitrate levels can lead to algal blooms in lakes and extreme levels in drinking water can cause the potentially fatal Blue Baby Syndrome or nitrate poisoning.

Nitrate leaching rates vary according to local soil conditions and temperatures, but increasing stocking rates and more use of feed supplements such as Palm Kernel Extract (PKE) have massively increased nitrate levels in catchments in the fastest-growing dairying areas of Southland and Canterbury.

The regulatory and political focus on nitrates has intensified over the last year and the issue is expected to be an election issue as the centre-right and pro-dairy National Government seeks a third term again a Labour/Green Opposition talking tough against more dairy expansion.

A warning by Canterbury's Chief Medical Officer of Health Alistair Humphrey in October last year that increasing nitrate levels could eventually lead to a Blue Baby Syndrome death unleashed a firestorm of debate. He was accused by farmers of scare-mongering, but the warning focused the public debate on nitrates.

It's a ticking time bomb, Humphrey was quoted as saying in Christchurch's The Press.

"Sooner or later, a mother will not be aware of her water supply and she might make up some formula and that might lead to a tragedy," he said.

His comments followed the release of Environment Canterbury's 2012 annual groundwater survey of 289 wells across the region, which found 11 per cent of the wells had nitrate levels above the Health Ministry's Maximum Acceptable Value (MAV) of 11.3 mg/litre of groundwater. It found nitrate levels had been rising in 30 per cent of the wells over the last decade.

Then the Parliamentary Commissioner for the Environment, Jan Wright, released a landmark report into land use and nutrient pollution in November last year. It documented rising nitrate levels in areas with the fastest growth of dairying and forecast dairying will have expanded by 650,000ha between 1996 and 2020.

The report's modeling found nitrate loadings had increased 27 per cent in Canterbury between 1996 and 2008, and were forecast to rise another 15 per cent by 2020.

"This investigation has shown the clear link between expanding dairy farming and increasing stress on water quality," Wright said.

"Even with best practice mitigation, the large-scale conversion of more land to dairy farming will generally result in more degraded fresh water," she said.

"New Zealand does face a classic economy versus environment dilemma."

The report turned up the heat on a debate that has been bubbling along since 2011 when the Government issued the first National Policy Statement for Freshwater Management. It was designed to set water quality standards for regional councils to start targeting, and essentially coaxing them towards more actively managing water quality.

Some councils, including Environment Canterbury and Manawatu/Wanganui's Horizons, have already begun actively setting targets and issuing resource consents for farmers. Others, including Waikato and Southland, have only just begun to assess and form their own targets.

Meanwhile, environment groups, farmers and regulators have been collaborating in a Land and Water Forum since 2009 to recommend ways to improve and regulate water quality and usage.

This all culminated in July with the release by Environment Minister Amy Adams of a new National Policy Statement that set minimum health standards for waterways, including that rivers and lakes must be safe enough to wade in and boat on, but not necessarily safe enough to swim in.

This decision not to make '100 per cent swimmable' a minimum standard unleashed a heated political debate. The Opposition Green and Labour parties both pledged to put '100 per cent swimmable' on their election platforms and pointed to Ministry of Environment figures showing 61 per cent of monitored swimming sites were judged poor or very poor.

Adams responded that councils who wanted to set their own 100 per cent swimmable standard could, but the National Government was not going to force one on regional councils.

"We are not going to impose billions of dollars of costs on ratepayers and communities in areas where they do not seek it," she said.

The expansion of dairying and the issue of nitrate leaching is set to become a campaign issue ahead of the September 20 election. It may not have the same electoral potency as the carbon tax did in Australia last year, but it is already a point of contention between the main contestants.

"I would say that rivers that you can swim in are a birthright for New Zealanders and we aim to have a clean, green economy for all New Zealanders and all rivers," Labour Leader David Cunliffe said in backing a 100 per cent swimmable standard.

Prime Minister John Key said such a target was unrealistic and would cost billions to achieve.

"Swimmable is a very, very high and expensive goal. If we were to make that the national standard it would have an enormous impact on the cost for rate payers - billions I think," he said in July.

Meanwhile, prominent philanthropist, economist and dot-com millionaire Gareth Morgan has launched a high-profile 'My River' campaign to push for all waterways to be safe for swimming, fishing and food gathering. This adds to a long-standing 'Dirty Dairying' campaign run by Fish and Game, a statutory body advocating for anglers and hunters.

The dairy industry is becoming increasingly aware of the regulatory headwinds and both Fonterra and many farmers are already trying to mitigate the effects of the boom on the environment.

The question is whether enough is done quickly enough to avoid much tougher regulatory sanctions being imposed from on high. National is set to be re-elected on current polling, but a many in the dairy industry are aware that much tougher rules are matter of when rather than if.

Fonterra's General Manager of policy and advocacy Carolyn Mortland says Fonterra has already pledged to fence off all waterways on farms and plant trees on the banks of those rivers and streams to reduce effluent run-off and reduce nutrient leaching. Every farm is also audited for its compliance with rules on effluent management.

More than 4,000 of Fonterra's 10,000 farmers were provided with reports from the Overseer software programme on their nitrogen leaching rates last year. It details what each farm's estimated nitrogen losses are relative to their peers in their district, given its soil type and climate.

"We're aware of the escalating concern," says Mortland.

Dairy NZ CEO Tim Mackle is also conscious of the growing environmental clamour and points out farmers are now more focused on improving production from their existing operations without necessarily increasing their nitrogen losses at the same time.

"We are facing more constraints and we have to deal with it," he says.

Farmers are increasingly looking for efficiencies in how they use water and how they apply fertilizer to reduce their nitrogen losses, given the expense of nitrogen-rich fertilisers such as Urea. Good environmental decisions are also good economic ones in this case.

One example is South Canterbury dairy farming couple Mark and Devon Slee, who use pivot irrigators and and an underground network of electronic soil moisture sensors to optimize their water use and reduce nitrogen losses on their former sheep farm.

They use Overseer and know their nitrogen losses are around 47 kg/ha per year, which is about the same rate as it was 20 years ago, despite a 50 per cent increase in production per cow and a 70 per cent increase in the number of cows per hectare. It is also about half the leaching rate of others in their district.

The Slees, who won the Ballance Farm Environment award this year, are increasingly seen as a model by industry leaders looking for production growth with a lighter environmental footprint.

"There's a fair bit of evidence that that will be the type of production growth possible in the future," says Federated Farmers Environment Spokesman Ian Mackenzie.

Dairy NZ's Mackle is also confident the industry can grow production around 2.5 per cent per year over the longer term, but mainly from productivity gains rather than from new conversions.

"There's been a sea change of attitude," Mackle says.

Photo: Jennifer Farmer.