The Yosemite Valley Railroad was constructed as a badly needed conveyance to Yosemite Valley in the days before the automobile. Visitation to Yosemite had been small, and the federal government wished to introduce the new park system to the public. A railroad through the Merced River Canyon from Merced was the answer to the challenging terrain. Thousands of acres of virgin timber forest and other natural resources along the way supported the building and operation of this rail line. From l906 until World War II, timber, gold, barium, limestone, freight, and visitors rode the rails to Yosemite National Park on this line.