In ancient China, hydraulic engineering was highly developed, and engineers constructed massive canals with levees and dams to channel the flow of water for irrigation, as well as locks to allow ships to pass through.