The city, and the palace grounds, was based largely on Chang'an (present-day Xi'an), the capital of China during the Tang dynasty, which was contemporary to the time when Nara was capital. Chang'an was in turn, like many ancient east Asian cities, based on a complex system of beliefs & laws of geomancy. This dictated the grid system of streets, as well as the necessity for spiritually protective shrines or temples to be placed at particular cardinal directions around the city. The city area measured from east to west and from north to south.