HOW TO

Calculate length of 2D lines considering elevation

Last Published: November 24, 2022

Summary

This article provides the steps to calculate the length of lines that are created with Z-values disabled, using elevation values from a surface or raster. The resulting length includes the vertical distance between two points.

Procedure

Taking into account that 2D lines do not have Z-values, they must be converted into a 3D layer to be used to calculate the length.

Note:
The Interpolate Shape tool requires either the 3D Analyst or Spatial Analyst license, while the Add Z Information tool requires a 3D Analyst license.
  1. In ArcGIS Pro, open the Geoprocessing pane.
  2. Search for the Interpolate Shape tool.
  3. Select the 2D line and surface as the inputs. In this example, a TIN was used as a surface, as shown in the next image.
Interpolate shape.jpg
  1. Run the tool and if needed, drag the output layer to the 3D Layers group in the Contents pane.
  2. In the Geoprocessing pane, search for the Add Z Information tool.
  3. Select the new line 3D layer, the 3-Dimensional Length output property and click Run.
Add 3D Information.JPG
  1. Open the attribute table to find a new field with the 3D length. The attribute table below shows the difference in length when the elevation is considered.
Table.jpg
Note:
You may consider using the Add Surface Information tool to calculate the length of 2D lines considering elevation values from a surface or raster. Please note that this tool ignores by default the Z values of the 3D features if used as input.

Article ID: 000028286

Software:
  • ArcGIS Pro

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options