# Add Z Information (3D Analyst)

## Summary

Adds information about elevation properties of features in a Z-enabled feature class.

Each 3D shape is examined and the selected properties are appended to the attribute table of the input feature class. The output options vary based on the feature's geometry.

## Usage

• The following list summarizes Z property options by geometry:

• Points—Z
• Multipoints—Z-minimum, Z-maximum, Z-mean, point count
• Polylines—Z-minimum, Z-maximum, Z-mean, 3D length, minimum slope, maximum slope, average slope, vertex count
• Polygons—Z-minimum, Z-maximum, Z-mean, 3D length, minimum slope, maximum slope, average slope, vertex count
• Multipatches—Z-minimum, Z-maximum, surface area, volume, minimum slope, maximum slope, average slope
• Slope is returned as a percentage value, or grade, and is calculated differently for each geometry type that supports this property.

• Slope values for line features are calculated for each line segment:
• Min slope is obtained from the segment whose value is closest to 0, or horizontal grade.
• Max slope is obtained from the segment with the largest calculated value.
• Average slope is obtained by averaging the slope of all line segments after weighing each segment by its 3D length. This results in longer segments having greater influence on the resulting value over shorter segments.
• Slope values for multipatch features are calculated for each triangle face.
• Min slope is obtained from the face whose value is closest to 0, or horizontal grade.
• Max slope is obtained from the face with the largest value.
• Average slope is obtained by averaging the slope of all triangle faces after weighing each segment by its 3-dimensional area. This results in larger areas having greater influence on the resulting value over smaller ones.
• Slope values for polygon features are only calculated for the feature edge using the same technique applied for line segments.
• Volume can only be computed for closed multipatches. An open multipatch feature will return a value of 0.0. On the Solaris platform, a design limitation currently prevents the tool from determining if a multipatch is closed, resulting in volume measurements being calculated for all multipatches under the assumption they are closed.

## Syntax

 Parameter Explanation Data Type in_feature_class The input feature class. Feature Layer out_property[out_property,...] The output Z properties that will be added to the attribute table of the input feature class. The following options are available: Z —The elevation of each single-point feature.POINT_COUNT —The number of points in each multipoint array.Z_MIN —The lowest elevation found in each multipoint, polyline, polygon, or multipatch feature.Z_MAX —The highest elevation found in each multipoint, polyline, polygon, or multipatch feature.Z_MEAN —The average elevation found in each multipoint, polyline, polygon, or multipatch feature.LENGTH_3D —The 3-dimensional length of each polyline or polygon feature. VERTEX_COUNT —The total number of vertices in each polyline or polygon feature.MIN_SLOPE —The lowest slope value calculated for each polyline, polygon, or multipatch feature.MAX_SLOPE —The highest slope value calculated for each polyline, polygon, or multipatch feature.AVG_SLOPE —The average slope value calculated for each polyline, polygon, or multipatch feature.VOLUME —The volume determined for each closed multipatch feature. String noise_filtering(Optional) Provides the option to exclude small portions of features from statistical calculations. This option is useful for obtaining good maximum slope estimates, as small portions often exhibit extreme slopes, which may bias the statistical results. The values given in either the Area or Length options will be used to exclude these portions of features. This parameter does not apply to point and multipoint features. NO_FILTER —No noise filter will be used. This is the default. AREA <…> —An area filter will be applied to portions of features in multipatch feature classes. An AREA value of 0.001 indicates that subparts of multipatches with an area less than 0.001 will be ignored. LENGTH <…> — A length filter will be applied to portions of features in a line or polygon feature class. A LENGTH value of 0.001 indicates that portions of features with a length less than 0.001 will be ignored. String

## Code Sample

The following sample demonstrates the use of this tool in the Python window:

```import arcpy
from arcpy import env

arcpy.CheckOutExtension('3D')
env.workspace = 'C:/data'
'NO_FILTER')```

The following sample demonstrates the use of this tool in a stand-alone Python script:

```'''******************************************************************
Description: This script demonstrates AddZInformation on all
z-aware features in a target workspace.
******************************************************************'''
# Import system modules
import arcpy
import exceptions, sys, traceback
from arcpy import env

try:
arcpy.CheckOutExtension('3D')
# Set environment settings
env.workspace = 'C:/data'
# Create list of feature classes
fcList = arcpy.ListFeatureClasses()
if fcList:
for fc in fcList:
desc = arcpy.Describe(fc)
if desc.hasZ:
# Set Local Variables
noise = 'No_Filter'
if desc.shapeType == 'Polygon':
Prop = ['Z_MIN', 'Z_MAX', 'VERTEX_COUNT']
elif desc.shapeType == 'Point':
Prop = 'Z'
elif desc.shapeType == 'Multipoint':
Prop = ['Z_MIN', 'Z_MAX', 'Z_MEAN']
elif desc.shapeType == 'Polyline':
Prop = 'LENGTH_3D'
arcpy.CheckInExtension('3D')
except arcpy.ExecuteError:
print arcpy.GetMessages()
except:
# Get the traceback object
tb = sys.exc_info()
tbinfo = traceback.format_tb(tb)
# Concatenate error information into message string
pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\
.format(tbinfo, str(sys.exc_info()))
msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2))
# Return python error messages for script tool or Python Window