Long before I conceived the idea of taking a journey halfway around the world and back on railway trains, a trip I turned into The Great Railway Bazaar, I was a contented traveller in a corner seat. As a boy, I took trolleys and trains from my home in Medford into Boston, and from Boston to New York. On graduating from university I travelled around Italy on trains, and later that same year I went to Africa and found steam trains that ran from Blantyre to Lake Nyasa, in one direction, and to the coast of Mozambique in the other. Train travel was an adventure and a relief; I liked the ease of it, the solitude, the freedom.

As a teacher in Singapore in the 1960s I took trains to Malaysia and Thailand, and within Burma and Indonesia. After that, in the 1970s, as an alien in south London, I travelled from Catford Bridge to Charing Cross. I liked the anonymity. I was indistinguishable from the other railway passengers. My London routine was always relieved by a trip on a train, no matter how short. The train allowed me to reflect on what I began to see as my plight, which was that, after having published so much, and having been such an earnest drudge, never turning away work, I was still living on the margin, in a tiny house in one of the dreariest parts of London.

The train was a break from the monotony, I looked forward to any jaunt on it, for the peace, the chuckle of the wheels over the points, the rattle of the carriage, the height of the tracks, elevated over the city so that I could peer down at the houses and the people and the traffic stalled on the Old Kent Road. I could think clearly on the London trains and when, on the rare occasions, I travelled out of London – on the Exeter line via Sherborne, Yeovil, and Crewkerne, to visit my in‑laws, or on the Flying Scotsman on a journalistic assignment, my spirits revived and I saw with clarity that it might be possible to conceive a book based on a long railway journey.

Inspiration also came from the satisfying shelf of English literature concerned with what we see from the train. The poems that begin, "O Fat White Woman" and "Yes, I remember Adlestrop" stand out, and so do the trains that run up and down the pages of PG Wodehouse and Agatha Christie. But the description that captures the English railway experience for me best is Ford Madox Ford's in his first successful book, The Soul of London, an evocation of the city, published in 1905. Looking out the train window, Ford speaks of sitting on a train and looking into the busy, muted world outside. "One is behind glass as if one were gazing into the hush of a museum; one hears no street cries, no children's calls." And his keenest observation, which was to hold true for me from London to Tokyo: "One sees, too, so many little bits of uncompleted life."

London railway stations were also full of suggestions. I often got the train to Blackfriars, to pick up books or deliver copy to the Times, which was then nearby at Printing House Square. Walking out of Blackfriars station, I would pass the Destination Wall, where place names were engraved in the granite slabs: Ramsgate and Ashford, as well as Paris, Naples, Venice and distant St Petersburg. London was connected by rail to the world. When I travelled via Victoria, another great terminus, I saw on the departures board the times of the boat trains to Folkestone and Dover, which left every day, to meet the cross-channel ferries to Boulogne and Calais.

Dreams often begin with a consciousness of exotic place names. And I wondered: Just how far could I go, if I began my train journey at Victoria, crossed to the continent, and boarded the train for Paris? I bought or borrowed a number of books, but the most useful one was the newest, that is the 1973 edition, of Thomas Cook's Overseas Timetable: Railway, Road and Shipping Services Outside Europe. "Timetable" gives the wrong impression. The book was an inch thick, dense with railway detail. I saw at once there were various routes to Istanbul, and onward to Ankara, Lake Van, with a connection to Tehran. Or I could go south to Mosul, Baghdad and Basra and cross over to Iran, where I could connect through Baluchistan, crossing the Pakistan border.

And that was only the beginning. The Overseas Timetable listed the major lines in India and Burma, in Sri Lanka and Thailand and Malaysia; the bullet trains in Japan, the times of the Trans-Siberian. This timetable, and the detailed map of Asia (showing all railway lines) I bought at Stanford's in Long Acre, Covent Garden, told me everything I needed to know and convinced me that such a long trip might be possible. It was simply a matter of changing trains.