HOW TO

Calculate the total length of lines in a polygon

Last Published: April 25, 2020

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.

This is the map of Colorado and Interstate roads.

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.
This is the Clip dialog box.
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.
This is the Intersect dialog box.
  1. 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.
This is the Statistics dialog box.
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.
This is the Dissolve dialog box.
  1. In Table Of Contents, right-click the dissolved layer generated. Click Open Attribute Table.
  2. In the attribute table, the Shape_Length column represents the total length of lines intersecting the polygon feature class.
This is the attribute table showing total length of line.

Article ID:000018432

Software:
  • ArcGIS Pro
  • ArcMap

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic