Surface Aspect (3D Analyst)
Summary
Creates polygon features that represent ranges of the horizontal direction of slope measurements from a triangulated surface.
Illustration
Usage
Each surface triangle's aspect is determined in units of degrees, then assigned an aspect code based on the cardinal or ordinal direction of its slope. Contiguous triangles of the same code are merged into one feature. The default classification scheme is defined as follows:
Code
Slope Direction
Slope Angle Range
-1
Flat
No Slope
1
North
0–22.5
2
Northeast
22.5–45
3
East
45–135
4
Southeast
135–180
5
South
180–225
6
Southwest
225–270
7
West
270–315
8
Northwest
315–337.5
9
North
337.5–360
Customized class definitions can be provided through a Class Breaks Table. The table must have two columns where the first indicates the aspect break point in degrees and the second defines its code value. Consider the following example:
Break
Aspect_Code
90.0
1
180.0
2
270.0
3
360.0
4
The table can be in any supported format (.dbf, .txt, or geodatabase table). The name of the fields are irrelevant, as the first will always be used for the class breaks and the second for the aspect codes.
Syntax
Parameter | Explanation | Data Type |
in_surface |
The TIN, terrain, or LAS dataset surface whose aspect values will be written to the output polygon. | LAS Dataset Layer; Terrain Layer; TIN Layer |
out_feature_class |
The output feature class. | Feature Class |
class_breaks_table (Optional) |
A table containing the classification breaks that will be used to define the aspect ranges in the output feature class. | Table |
aspect_field (Optional) |
The field containing aspect code values. | String |
pyramid_level_resolution (Optional) |
The z-tolerance or window-size resolution of the terrain pyramid level that will be used by this tool. The default is 0, or full resolution. | Double |
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.SurfaceVolume_3d("sample.gdb/featuredataset/terrain", "surf_vol.txt",
"ABOVE", 300, 1, 5)
The following sample demonstrates the use of this tool in a stand-alone Python script:
'''****************************************************************************
Name: Surface Volume Example
Description: This script demonstrates how to use the
Surface Volume tool.
****************************************************************************'''
# Import system modules
import arcpy
from arcpy import env
import exceptions, sys, traceback
try:
# Obtain a license for the ArcGIS 3D Analyst extension
arcpy.CheckOutExtension("3D")
# Set environment settings
env.workspace = "C:/data"
# Set Local Variables
inSurface = "elevation_tin"
#Execute SurfaceVolume
result = arcpy.SurfaceVolume_3d(inSurface, "", "ABOVE", "300", "1", "5")
print result.GetMessage(0)
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)