表面坡向 (3D Analyst)

摘要

计算 TIN 或 terrain 数据集中每个三角形的最陡下坡坡度的坡向或方向,并将输出写为面要素类。

插图

TIN Aspect illustration

用法

语法

SurfaceAspect_3d (in_surface, out_feature_class, {class_breaks_table}, {aspect_field}, {pyramid_level_resolution})
参数说明数据类型
in_surface

输入 terrain 或 TIN 表面。

Terrain Layer; TIN Layer
out_feature_class

The output feature class.

Feature Class
class_breaks_table
(可选)

包含将用于对输出要素类中的坡向范围进行定义的分类间隔的表。

Table
aspect_field
(可选)

包含坡向编码值的字段。

String
pyramid_level_resolution
(可选)

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

代码示例

SurfaceAspect 示例 1(Python 窗口)

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)
SurfaceAspect 示例 2(独立脚本)

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)

环境

相关主题

许可信息

ArcView: 需要 3D Analyst
ArcEditor: 需要 3D Analyst
ArcInfo: 需要 3D Analyst

7/10/2012