THERE is something magical about a steam train powering its way across the grand Yorkshire landscape. Even movie moguls recognise that. Last year they chose Goathland as the location to recreate Harry Potter's Hogsmead Station for the eagerly awaited film of the trainee wizard's adventures.

Those scenes were made possible by the revival of steam on the North Yorkshire Moors Railway, which has delighted young and old alike. Along with the National Railway Museum, that railway proves our fascination with this very special form of travel is unabated.

Flick through two new books, and you are transported back to a time when locomotives were neither heritage or Hollywood but working machines. Railways Of The North York Moors and Railways Of The Yorkshire Dales are packed with pictures of steam trains pulling freight and passengers against a variety of glorious backdrops.

Both books are compiled by Michael Blakemore, the editor of historic railways magazine Backtrack and self-confessed Lancastrian. Childhood holidays in Scarborough imbued him with a love of this side of the Pennines, and that appreciation is clear in his commentaries.

The work of the North Yorkshire Moors Railway trustees preserved one of the most historic lines in the country. George Stephenson himself engineered a route from Whitby to Pickering. But the trains that originally ran along it were pulled by hard-working horses. Bridges, such as the one over the River Esk, were made of timber.

It only became a modern locomotive line in 1845, when the York & North Midland Company's railway from York to Scarborough inspired an upgrade.

Mr Blakemore points out that the original North York Moors railway network served local industry, notably ironstone mining in the Esk Valley and in Rosedale. And it became a lifeline for locals during the regularly harsh winters.

But its biggest influence was on tourism. On the Whitby and Pickering Railway, Mr Blakemore writes, "traffic reached its peak between the wars.

"The LNER's 'Scarborough Flier' from King's Cross included through coaches for Whitby, while scenic excursions were run from the West Riding or Hull travelling out via Pickering to Whitby and returning over the coast line via Robin Hood's Bay."

Certain locomotives were built specifically to cope with the "fearsome" gradients of the Scarborough-Whitby line. These were known as "Wicked Willies" and their extra power was welcome.

One of the steepest climbs took trains back up the cliffs from Robin Hood's Bay. In the 1900s, the village boasted the busiest station on the line, serving holidaymakers and offering watering facilities for locomotives going in either direction.

In Ryedale in 1866, the North Eastern Railway sought to build a branch line from Gilling North to Helmsley then through Kirkbymoorside and on to Pickering. The station sign writers omitted the second 'k' in Kirkbymoorside, a mistake only rectified decades later.

This branch served the villages and market towns until the new, more convenient bus service brought its closure in the 1950s.

The Yorkshire Dales railways were subject to the same ebb and flow of passenger popularity.

In the introduction to Railways of the Yorkshire Dales, Mr Blakemore writes: "Whilst large parts of the smaller dales have been undisturbed by the coming of railways, most of the larger dales were opened up to rail travel either by terminating branch lines or by cross country routes connected to other lines at either end...

"As with so many secondary railways, those of the Yorkshire Dales have not fared too well with the passing of time. The Grassington branch passenger service ceased in 1930, the Wensleydale and Pateley Bridge branches followed during the 1950s and the sweeping cuts of the 1960s further took their toll, including the main line through Ripon."

The changing times were encapsulated on May 30, 1967. Then, a loco called Alberta was unexpectedly used to head the train conveying the Duke of Edinburgh from York to Nidd Bridge. This was the last time a Royal Train was hauled by steam.

In the golden age of steam, express trains would regularly thunder along a long-vanished main line to the east of Nidderdale. Trains from Liverpool to Newcastle were among those to use the route from Harrogate through Ripon to Northallerton.

The market town of Richmond stands as the gateway to Swaledale. Lead was mined for hundreds of years further up the valley. The need to transport the lead, and the increasing demands of the new tourists, made a Swaledale railway an obvious attraction to promoters.

Railway architect George Townsend Andrews, designer of York's first railway station and subject of a previous Yesterday Once More, created a "handsome terminus" for Richmond.

Although the lead mining industry declined, the railway enjoyed a compensatory boost with the opening of a large Army camp at Catterick in 1915.

"A military railway, with a total mileage of some five miles, was built to serve it. At the time of its establishment the Great War was at its height and up to 45,000 men were stationed at the camp at any one time, with some 750,000 passing through it in a year."

In 1911, the Swaledale branch pioneered a new technique which gave an indication in locomotive cabs as to the position of signals during fog. "The system was taken out of use in the early 1920s but it can be counted as one of many steps along the way to the Advanced Warning System in use today and, indeed, the Automatic Train Protection envisaged for the future," writes Mr Blakemore.

The two books, the first volumes in the Backtrack Byways series, will fascinate railway buffs. But even those who are less interested in the technical details cannot fail to be affected by the magic of the steam age, captured in so many photographs.

Railways Of The Yorkshire Dales and Railways Of The North York Moors are both published by Atlantic, price £9.99