Rain water flows from the roof to gutters and discharges through downspouts. Drain-tile can be connected to the downspout to direct the water away from the house, and protect the foundation from moisture. Drain tile, or pipe, is sold in lengths, and estimating the quantity needed is a simple calculation based on taking a linear measurement of the area.