A lock allows boats to travel through a canal that changes in elevation.