History of rail transport in Namibia
The history of rail transport in Namibia began with a small mining rail line at Cape Cross in 1895. The first major railway project was started in 1897 when the German Colonial Authority built the gauge "Staatsbahn" (State Railway) from Swakopmund to Windhoek. By 1902 the line was completed. Parallel to this government initiative, the Otavi Mining and Railway Company (O.M.E.G.) was established. It built another gauge line, the "Otavibahn", from Swakopmund to Tsumeb via Otavi between 1903 and 1906, and a branch from Otavi to Grootfontein in 1907/08. The German colonial railway was  taken over by the Railways of South Africa after World War I, and linked into the network of South Africa. After the independence of Namibia, TransNamib took control of the national rail network, which, by that time, had long since been converted to gauge. German colonial period. Beginnings. The basic structure of the Namibian railway system dates from the time when the country was a colony of the German Empire known as German South West Africa. This arid part of the African continent was not very productive for agriculture. Initially, overland transport was operated entirely by ox-cart. A small  mining rail line opened at Cape Cross in 1895. Soon afterwards, the ox-cart transport system totally collapsed, in the wake of a rinderpest epidemic in 1897. As it was necessary to react quickly to the now extremely precarious transport situation, decisions were made: Train services on the whole of the new line, which was called the "Staatsbahn" (State Railway), began on 19 June 1902. Network development. Construction of the railways connecting with the "Staatsbahn" was aimed partly at military strategic objectives following the uprising of the Herero and Nama, and partly at economic requirements. By World War I, the  following lines had been developed (listed by first year of full operation): Industrial railway of the diamond fields. The 600mm gauge industrial railway of the diamond fields, between Kolmannskuppe and Bogenfels, was electrified from 1911, and thus became, to this day, the only electric railway in Namibia. As the diamond mining was always moving further south, the northern part of the line as far as Pomona was abandoned in 1931, and some of its materials were used for the extension of the railway towards Oranjemund. The southern section was operated with diesel traction. The industrial railway no longer exists  today; the lifting of the line was carried out by bulldozers and trucks. World War I and after. With the outbreak of World War I, the German "Schutztruppe" military unit retreated from the coast, and withdrew into the inland. In the process, the "Schutztruppe" destroyed the "Otavibahn", and the old "Staatsbahn" towards Karibib, as far as Rössing. British troops immediately moved forward from the British enclave of Walvis Bay, and by the end of 1914 they had built a long railway to Swakopmund. The "Otavibahn" was also reconstructed in as far as Usakos, and the section between Usakos and Karibib  was realigned. The network north of Usakos remained in gauge; the workshop for both gauges was consolidated in Usakos, and the one in Karibib was closed. Neighbouring South Africa was also an enemy of the German Empire. From there, a new railway was constructed – as an extension of the De Aar-Prieska railway – to achieve a secure supply route for the South African troops. In 1916, the line was connected to the German network at Kalkfontein (now Karasburg). Network expansion. Under South African/British occupation, the following lines were established (listed by first year of full operation): Mandate period. From  August 1915 the Namibian railway network was operated de facto by South African Railways, and this arrangement became official in 1922. From 1959, steam locomotives were gradually replaced by diesel locomotives, for which an engine-house was built in Windhoek. This made operations very much easier, because water is in short supply in Namibia, and the coal needed to heat the water in the steam locomotives also had to be procured from the Transvaal. Independence. After the independence of Namibia, TransNamib took control of the national rail network.