A moat, also called a city wall, is defined as a river that people dig around the city wall. In ancient times, it was used for defense. It was excavated in ancient times and surrounded the whole city, palaces, temples and other major buildings. It has a defensive function and can prevent the invasion of enemies or animals.