TIN 三角形 (3D Analyst)

摘要

将三角面从不规则三角网 (TIN) 数据集导出到面要素类,并为每个三角形提供山体阴影的坡度、坡向和可选属性以及标签值。

插图

TIN Triangle illustration

用法

语法

TinTriangle_3d (in_tin, out_feature_class, {units}, {z_factor}, {hillshade}, {tag_field})
参数说明数据类型
in_tin

The input TIN.

TIN Layer
out_feature_class

The output feature class.

Feature Class
units
(可选)

The units of measure to be used in calculating slope.

  • PERCENTSlope is expressed as a percentage value. This is the default.
  • DEGREESlope is expressed as the angle of inclination from a horizontal plane.
String
z_factor
(可选)

The factor by which elevation values will be multiplied. This is typically used to convert Z linear units that match those of the XY linear units. The default is 1, which leaves elevation values unchanged.

Double
hillshade
HILLSHADE <azimuth>, <angle>
(可选)

为要素图层输出应用山体阴影效果时指定光源的方位角和高度角。方位角的范围为 0 至 360 度,高度角的范围为 0 至 90。方位角为 45 度,高度角为 30 度的输入形式为“HILLSHADE 45, 30”

String
tag_field
(可选)

将存储三角形标签值的输出要素中的字段名称。该参数默认为空,将导致标签值无法写入输出。

String

代码示例

TinTriangle 示例 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.TinTriangle_3d("tin", "tin_triangle.shp", "DEGREE", 1,"HILLSHADE 310,45", "tag")
TinTriangle 示例 2(独立脚本)

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

'''****************************************************************************
Name: TinTriangle Example
Description: This script demonstrates how to use the 
             TinTriangle tool to extract triangles from each TIN in the 
             target workspace.
****************************************************************************'''
# Import system modules
import arcpy
from arcpy import env
import exceptions, sys, traceback

try:
    arcpy.CheckOutExtension("3D")
    # Set environment settings
    env.workspace = "C:/data" # the target workspace
    # Create list of TINs
    TINList = arcpy.ListDatasets("*", "Tin")
    # Verify the presence of TINs in the list
    if TINList:
        for dataset in TINList:
            # Set Local Variables
            TINList = arcpy.ListDatasets("*", "Tin")
            slopeUnits = "PERCENT"
            zfactor = 1
            hillshade = "HILLSHADE 300, 45" # defines hillshade azimuth & angle
            tagField = "Tag"
            Output = dataset + "_triangles.shp" # name of the output file
            #Execute TinTriangle
            arcpy.ddd.TinTriangle(dataset, Output, slopeUnits, zfactor,
                                  hillshade, tagField)
            print "Finished."
    else:
        print "There are no TIN(s) in the " + env.workspace + " directory."
    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)

环境

相关主题

许可信息

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

7/10/2012