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:
- 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
- In ArcMap, navigate to the main menu, and click Geoprocessing > Clip. For more information, refer to ArcGIS Help: Clip.
- For Input Features, select the line feature class. The Output Feature Class is generated once Input Features is specified.
- For Clip Features, select the polygon feature class.
- Click OK.
Using the Intersect tool
- In ArcMap, navigate to the main menu, and click Geoprocessing > Intersect. For more information, refer to ArcGIS Help: Intersect.
- 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.
- Click OK.
- 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
- In Table Of Contents, right-click the layer generated in Step 1. Click Open Attribute Table.
- 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.
- 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.
- In ArcMap, navigate to the main menu, and click Geoprocessing > Dissolve. For more information, refer to ArcGIS Help: Dissolve.
- For Input Features, select the layer generated in Step 1.
- Check the Create multipart features option.
- Click OK.
- In Table Of Contents, right-click the dissolved layer generated. Click Open Attribute Table.
- In the attribute table, the Shape_Length column represents the total length of lines intersecting the polygon feature class.