Bangkok is a relatively young capital, established in 1782 after the Burmese sacked Ayutthaya, the former capital. A temporary base was set up on the western bank of the Chao Phraya, in what is now Thonburi, before work started on the more defensible east bank. The first king of the new dynasty, Rama I, built his palace at Ratanakosin , within a defensive ring of two (later expanded to three) canals, and this remains the city's spiritual heart. Initially, the city was largely amphibious: only the temples and royal palaces were built on dry land, while ordinary residences floated on thick bamboo rafts on the river and canals, and even shops and warehouses were moored to the river bank. In the late nineteenth century, Rama IV and Rama V modernized their capital along European lines, building roads and constructing a new royal residence in Dusit, north of Ratanakosin.
Since World War II, and especially from the mid-1960s onwards, Bangkok has seen an explosion of modernization, leaving the city without an obvious centre. Most of the canals have been filled in, to be replaced by endless rows of concrete shophouses, sprawling over a built-up area of 330 square kilometres. The benefits of the economic boom of the 1980s and early 1990s were concentrated in Bangkok, which attracted mass migration from all over Thailand and made the capital ever more dominant: Bangkokians now own four-fifths of the nation's cars and the population is forty times that of the second city, Chiang Mai