表面坡向 (3D Analyst)

许可等级:BasicStandardAdvanced

摘要

计算 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

输出要素类。

Feature Class
class_breaks_table
(可选)

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

Table
aspect_field
(可选)

包含坡向编码值的字段。

String
pyramid_level_resolution
(可选)

此工具将使用 terrain 金字塔等级的 z 容差或窗口大小分辨率。默认值为 0(z 容差),或全分辨率(窗口大小)。

Double

代码实例

SurfaceAspect 示例 1(Python 窗口)

下面的示例演示了如何在 Python 窗口中使用此工具:

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(独立脚本)

下面的示例演示了如何在独立 Python 脚本中使用此工具:

'''****************************************************************************
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)

环境

相关主题

许可信息

ArcGIS for Desktop Basic:需要 3D Analyst
ArcGIS for Desktop Standard:需要 3D Analyst
ArcGIS for Desktop Advanced:需要 3D Analyst
9/15/2013