Feature To 3D By Attribute (3D Analyst)

Summary

Creates 3D features using height values derived from the attribute of the input features.

Usage

  • Supports point, multipoint, line, and polygon geometries.

  • Each feature's elevation will be derived from the value obtained in the specified height field. Line features can optionally provide a second height field. Using two height fields will result in each line feature starting from the Z-value obtained in the first height field and ending at the Z-value from the second height field. The heights for any intermediate vertices will be interpolated based on the slope of the line between the two endpoints.

Syntax

FeatureTo3DByAttribute(in_features, out_feature_class, height_field, {to_height_field})
ParameterExplanationData Type
in_features

The features that will be used to create 3D features.

Feature Layer
out_feature_class

The feature class that will be produced by this tool.

Feature Class
height_field

The field whose values will define the height of the resulting 3D features.

Field
to_height_field
(Optional)

An optional second height field used for lines. When using two height fields, each line will start at the first height and end at the second (sloped).

Field

Code sample

FeatureTo3DByAttribute example 1 (Python window)

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

arcpy.env.workspace = 'C:/data'
arcpy.FeatureTo3DByAttribute_3d('Points2D.shp', 'Points3D.shp', 'Elevation')
FeatureTo3DByAttribute example 2 (stand-alone script)

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

'''****************************************************************************
Name: FeatureTo3DByAttribute Example
Description: This script demonstrates how to use the
             FeatureTo3DByAttribute tool.
****************************************************************************'''
# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = 'C:/data'

# Set Local Variables
InFC = 'Points_2D.shp'
Height_Field = 'POPULATION'

# Ensure output has unique name
OutFC = arcpy.CreateUniqueName('Points_3D.shp')

# Execute ConstructSightLines
arcpy.FeatureTo3DByAttribute_3d(InFC, OutFC, Height_Field)

Licensing information

  • Basic: Requires 3D Analyst
  • Standard: Requires 3D Analyst
  • Advanced: Requires 3D Analyst

Related topics