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 Z properties are available:
- 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 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 calculated along the edges using the same technique applied for line segments.
- Slope values for line features are calculated for each line segment:
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 Z properties that will be added to the attribute table of the input feature class. The following options are available:
| 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.
| 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'
arcpy.AddZInformation_3d('lines_3D.shp', 'Z_MEAN; LENGTH_3D; AVG_SLOPE',
'NO_FILTER')
The following sample demonstrates the use of this tool in a stand-alone Python script:
'''******************************************************************
Name: AddZInformation Example
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'
print 'Completed adding Z information.'
# Execute AddZInformation
arcpy.AddZInformation_3d(inFC, Prop, noise)
arcpy.CheckInExtension('3D')
except arcpy.ExecuteError:
print arcpy.GetMessages()
except:
# Get the traceback object
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
# Concatenate error information into message string
pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\
.format(tbinfo, str(sys.exc_info()[1]))
msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2))
# Return python error messages for script tool or Python Window
arcpy.AddError(pymsg)
arcpy.AddError(msgs)