 The layout of ancient Chinese capitals , such as Bianjing , capital of the Northern Song , followed the guidelines in Kao Gong Ji , which specified a square city wall with several gates on each side and passageways for the emperor . The outer city of ancient Bianjing was built during the reign of Emperor Shenzong to a rectangular plan , almost square in proportions , about 6 km ( 3 @.@ 7 mi ) from north to south and 7 km ( 4 @.@ 3 mi ) from west to east . The south wall had three gates , with Nanxun Gate in the center , Chenzhou Gate to the east , and Dailou Gate to the west . The other walls had four gates each : in the east wall were Dongshui Gate ( at the southern end ) , Xinsong Gate , Xinchao Gate , and North @-@ East Water Gate ; in the west wall Xinzheng Gate , West Water Gate , Wansheng Gate , and Guzi Gate ; and in the north wall Chenqiao Gate ( at the eastern end ) , Fengqiu Gate , New Wild Jujube Gate and Weizhou Gate . The gates in the center of each of the four sides were reserved for the emperor ; these gates had straight passages and only two sets of doors , while the other city gates had zigzag passages and were guarded by three sets of doors . 
