Royton's damp climate provided the ideal conditions for cotton spinning to be carried out without the cotton drying and breaking, and newly developed 19th century mechanisation optimised cotton spinning for mass production for the global market. By 1832, there were 12 steam powered mills in Royton, of which its former hamlets had begun to agglomerate as a town around the cotton factories, a number of small coalpits and new turnpike road from Oldham to Rochdale, which passed through the town centre. The Manchester, Oldham and Royton Railway and a goods yard was constructed in the 1860s, allowing improved transportation of textile goods and raw materials to and from the township. Neighbouring Oldham (which by the 1870s had emerged of the largest and most productive mill town in the world) had begun to encroach upon Royton's southern boundary, forming a continuous urban cotton-spinning district. The demand for cheap cotton goods from this area prompted the flotation of cotton spinning companies; the investment was followed by the construction of 22 new cotton mills in Royton. Together with Oldham, at its peak the area was responsible for 13% of the world's cotton production.