A small town in Midlothian, Bonnyrigg is located 6 miles (10 km) southeast of Edinburgh in the parishes of Cockpen and Lasswade. Bonnyrigg was a mining village until the 1920s and had a carpet factory that was demolished in 1994. The village centre mostly dates from the 19th Century though buildings at the main crossroads were built in the 1960s. In 1929 it united with Lasswade.
In nearby Polton are found buildings from the 18th and 19th centuries including De Quincey Cottage (home of the writer Thomas de Quincey, 1840-59), Blairesk Hall (c.1818) and Midfield House (18th-century, reconstructed 1914).