English

# How To: Calculate the total length of lines in a polygon

## Summary

In some instances, it may be necessary to calculate the total length of lines within a polygon. For example, the extent of roads to be repaired, the new roads for construction within national parks, the total length of fences to be constructed surrounding a property, or the sum of hurricane paths in an area.

The image below is intended to show the interstate highways that pass through the State of Colorado. The total length of these highways within the Colorado polygon can be calculated.

## Procedure

The following workflow describes how to calculate the total length of lines within a polygon:

1. Find the intersect between the lines and the polygon feature class. There are two ways to do this, using the Clip tool or the Intersect tool.

Using the Clip tool
1. In ArcMap, navigate to the main menu, and click Geoprocessing > Clip. For more information, refer to ArcGIS Help: Clip.
2. For Input Features, select the line feature class. The Output Feature Class is generated once Input Features is specified.
3. For Clip Features, select the polygon feature class.
4. Click OK.

Using the Intersect tool
1. In ArcMap, navigate to the main menu, and click Geoprocessing > Intersect. For more information, refer to ArcGIS Help: Intersect.
2. For Input Features, select the layers involved (lines and polygon) from the drop-down list. The Output Feature Class is generated once Input Features are specified.
3. Click OK.

2. Determine the total length of intersection. There are two ways to do this, using the Statistics command or from the attribute table of a dissolved layer.
Using the Statistics command
1. In Table Of Contents, right-click the layer generated in Step 1. Click Open Attribute Table.
2. In the attribute table, right-click the Shape_Length field header, and click Statistics. For more information, refer to ArcGIS Help: Viewing statistics for a table.
3. In the Statistics window, the total length is represented by the Sum field.

From the attribute table of a dissolved layer
```Note:
The Dissolve tool is available with an ArcGIS Desktop Advanced license.```
1. In ArcMap, navigate to the main menu, and click Geoprocessing > Dissolve. For more information, refer to ArcGIS Help: Dissolve.
2. For Input Features, select the layer generated in Step 1.
3. Check the Create multipart features option.
4. Click OK.

5. In Table Of Contents, right-click the dissolved layer generated. Click Open Attribute Table.
6. In the attribute table, the Shape_Length column represents the total length of lines intersecting the polygon feature class.