The city of Dadu of the Yuan dynasty had an extensive moat system in and around the city. After Ming troops entered Dadu in 1368, the northern wall was rebuilt slightly south of the original. The new wall was constructed on the piled earthen hill formed from digging the moat of Dadu. A new moat system was built for the three main southern gates of the Palace, Imperial, and Inner city quarters. The three moats were then linked to the eastern and western moats of Dadu. When the Outer city was reconstructed during the Jiajing era (1521–1567), another moat was built surrounding the outer wall.
The water for the moats was spring water diverted from Mount Yuquan and Baifuquan, northwest of the city. The water followed Changhe and then split into two tributaries at Xizhimen. One route went east, forming the Inner city's moat system, and then divided into two further tributaries at Deshengmen, one flowing south, the other east. The other route entered at Jishuitan in the south, formed the three lakes of the imperial gardens, and finally rejoined the moat system at Tongzihe. From there the water flowed along the curvature of the city wall and joined the city's southern moat system at Zhengyangmen. The eastern route turned 90 degrees south at the northeastern corner guard tower and converged with the city's southern moat system to the northwest of Dongbianmen. Another moat flowed westwards and then southwards, forming the Outer city's moat system. It converged with the Inner city's southern and eastern moat systems at Dongbianmen, and finally entered the Tonghui River.
The Inner city's moat system was widest, at 30 to 50 metres, to the southeast of Zhengyangmen. The narrowest point, a mere 10 metres in width, was the section between Dongzhimen and Chaoyangmen. The moat was three metres deep at its deepest point, and a metre deep at its most shallow, near Fuchengmen. The outer moat was narrower and shallower than that of the Inner city. By the end of the Qing dynasty, the artificial moat system behaved no differently from a natural river system.
Water passageways located at several locations along Beijing's city walls helped permit the flow of the water supply into and out of the city. There were seven passageways in the Inner city: Deshengmen West (entered the Inner city, three passages), Dongzhimen South (left the city, one passage), Chaoyangmen South (left the city, one passage), Chongwenmen East (left the city, one passage),
Zhengyangmen East (left the city, one passage), Zhengyangmen West (left the city, three passages), and Xuanwumen West (left the city, one passage). There were three passageways in the Outer city: Xibianmen East (entered the Outer city, three passages), Dongbianmen West (entered the Outer city, three passages), and Dongbianmen East (the main drainage for the inner and outer cities, three passages). The passageways had rammed earth foundations covered with stone slabs and stone bricks, followed by a layer of bricks. Each passageway had two or three layers of iron railings, and plenty of soldiers on guard.
The moat system influenced the daily activities of Beijing's commoners. From the Yongle era (1402–1424) until the mid-Qing dynasty (1644–1912), the eastern sections of the southern moat system were used as canals for the transportation of staple foods entering the city. Commoners could board boats at the eastern moat system, travel southwards to leave the city at Dongbianmen, and go down the Tonghui River, which leads to the rural areas of Tongzhou. Every year during the Hungry Ghost Festival, people would place small ships containing candles on the water. When frozen in winter, the moats were used as shortcuts in and out of the city. There would be skating, and the ice would be cut and saved underground for use in the summer months. The moats were home to many fish and ducks.
In 1953, Beijing's moat system was measured at 41.19 kilometres. As the city continued to expand, the moat system was no longer used, and much of it was channeled underground. The moat systems of the three main southern gates became underground rivers during the 1960s. The western, eastern, and northern moat systems were covered in the 1970s. A few remnants remain of the Inner city's northern moat system, the Outer city's southern moat system, and the imperial and Forbidden city's systems.
Above content from Wikipedia
现今北京城的前身——元大都城的四周都有护城河。1368年明朝军队占领元大都后将北城墙南移,利用挖土筑城后留下的沟渠修建了北护城河,同时开凿出前三门护城河,使原先元大都的东、西护城河与前三门护城河相连接。嘉靖朝修筑外城墙时,也开凿了护城河。
北京护城河水系来水方向为西北玉泉山、白浮泉等地,经长河抵西直门外高梁桥,然后分为两路。一路向东,经德胜门水关再分为两支,南支注入城中积水潭、三海,进入宫城护城河(筒子河),然后经正阳门东水关流入内城南护城河;东支继续东行,在东北角楼处南转成为东护城河,在东便门西水关以北同内城南护城河合流。第二路从高梁桥向南,在西便门水关分为两支,一支转向东,成为内城南护城河;另一支向西、向南,成为外城护城河,在东便门水关与内城南护城河和东护城河汇合,注入通惠河。
北京内城护城河以正阳门之东的南河道最宽,为30至50米;东直门与朝阳门间河道最窄,约10米。河水最深处3米,最浅处(阜成门附近)为1米左右。外城护城河比内城窄、浅。经过多年使用,至清朝末年,护城河已与天然河道无异。
在北京城墙上设有水关,为城市进水、排水通道。内城有七座水关:德胜门西水关(内城进水口,三孔)、东直门南(排水口,一孔)、朝阳门南(排水口,一孔)、崇文门东(排水口,一孔)、正阳门东(排水口,一孔)、正阳门西(排水口,三孔)、宣武门西水关(排水口,一孔)共七座水关。外城设西便门东水关(外城进水口,三孔)、东便门西水关(外城进水口,三孔)和东便门东水关(内城、外城总排水口,三孔)共计三座水关。水关基础为三合土夯筑,上覆石板、石块,再覆城砖,顶部砌成券顶式或过梁式。每座水关均设二至三层铁栅栏,并派士兵看守。
护城河对旧时北京的城市生活发挥了巨大的作用。明朝永乐年间至清朝中叶,南护城河东段为水路运送漕粮的主要渠道。而前三门护城河和南护城河是冬季冰上运输线。百姓出游多从东护城河登舟,沿河南行出东便门,经通惠河远游通州一带。每逢中元节,黎民百姓涌向前三门护城河,放河灯、赏河灯,冬季则从河上取冰。此外护城河内还种植莲藕、茨实,养殖鱼鸭,在经济方面具有很高的价值。
1953年的测算数据显示,北京护城河的总长为41.19公里。然而随着北京城区面积的快速扩大,护城河相继被填或变成了暗河。1960年代,前三门护城河被改成暗河;西护城河、东护城河、北护城河相继在70年代被改成了暗河。如今,北京护城河只有内城北护城河、外城的南护城河还保留了露天河道。
以上内容来自维基百科