When long-term Spanish resident Naomi Owen taught English in Granada in the 1990s, every year in the last week of June she would invariably be woken at 4am by the sound of bleating and thunder of hooves as flock after flock of sheep swept by her first-floor flat.

"They would be using the drovers' lanes," Owen recalls, "even if they were buried under the tarmac, they'd still use the route at night."

Today, Spain's once magnificent network of greenways, despite apparently strong state protection, is fast dwindling. And with it the centuries-old practice of driving herds of cattle and sheep from lowland winter pastures to summer upland grazings – known as transhumance – is on its last legs.

In Andalucia alone, some 76 per cent of the 30,000 kilometres (18,600 miles) of greenways were recently estimated as being blocked off or otherwise inaccessible, while the 200,000 or so cattle and sheep which went through transhumance in the early 1990s has now dropped to a tenth of that number. And the numbers continue to shrink, remorselessly.

"In December 2009 the Yebra y Pereira family in the village of Laroles in the province of Granada decided to walk with their herds to the sierras of Cordoba" – a 350-kilometre trip each way – "and come back the following summer," says Hilario Vilavilla, a Madrid-based geographer and spokesman for the Ecologistas en Accion pressure group. "This year they haven't done it."

Jose Antonio Torres, 51, one of Spain's last drovers, recently told the newspaper El Pais. "You have to have been born into transhumance to go on doing it because it's getting less and less profitable and the compli-cations are getting greater and greater."

These days, when Torres, the Yebra y Pereira family and others embark on these journeys with their herds, everything from housing estates to reservoirs, roads and barbed wire fencing have been reported as obstructing their progress. There are even reports of poison being daubed on to the pasturelands that their cattle use.

One of the most infamous examples of greenway blockage is an estate belonging to the star bull-fighter Ortega Cano in western Spain, which was built across a drovers' lane and has forced the transhumance herds on to a busy road nearby.

Even those greenways that are not completely blocked off can be in poor shape, as The IoS confirmed with a random spotcheck last week in southern Spain. Opposite a vast shopping centre, a black cow on a triangular sign with the words "via pecuaria" (drovers' way) stares mournfully down on a stream of traffic roaring past, all of it two- or four-wheeled rather than four-legged.

"On the western side of Madrid the greenways are in good shape," comments Jacinto Vidarte, a keen mountain biker who regularly rides along them. "But round on the south side, they are much worse," he adds. The most notorious case being the Galiana greenway near Madrid, which has morphed into what local councillors call the largest shanty town in Europe.

Around 40,000 people are crammed into a 14-kilometre long and 75-metre wide crime-and-drug-riddled corridor of misery and poverty. Madrid regional council's solution earlier this year to the rash of illegal shacks and heroin dealers' mansions was brutal and controversial: scrap the Galiana's greenway status. "The steady disappearance of greenways is just one of the factors threatening transhumance," Vilavilla points out. "There's the loss of open pastureland, the perpetually increasing paperwork whenever you shift livestock, the lack of unity between the drovers, and their shrinking numbers."

In comparison with three other western European regions where transhumance still occurs – in France's Alpine foothills, through the former Yugoslavian states and across Italy's Apennines, where some tratturi have been dated back to the Iron Age – Spain's laws governing their tracks are much more rigorous.

"They were the motorways of the Middle Ages," Vilavilla says, "and the laws have been strict to respect that."

"But the problem nowadays is how those laws are applied. In parts of Andalucia and Extremadura they provide the drovers with bothies and enclosures, but then in Madrid they have put in streetlights and swings and they are virtually boulevards, and in Murcia the farmers have land-grabbed all the greenways and it's chaos. Then, of course, there's the Galiano ghetto."

The reasons for reversing this process are numerous. Quite apart from producing top quality meat and wool, given that the herds feed on natural grasslands, as Vilavilla points out, "transhumance is far cheaper and more ecological than transport by road, and it benefits biodiversity, too... scientific studies by the Andalucian government discovered greenways can act as protected corridors over hundreds of kilometres for extremely rare and highly mobile animals such as the Iberian Lynx, or are sanctuaries for rare breeds of plant, such as types of rockrose.