TIN 面标签 (3D Analyst)

许可等级:BasicStandardAdvanced

摘要

使用不规则三角网 (TIN) 数据集中的标签值创建面要素。

插图

TIN Polygon Tag illustration

用法

语法

TinPolygonTag_3d (in_tin, out_feature_class, {tag_field})
参数说明数据类型
in_tin

输入 TIN。

TIN Layer
out_feature_class

输出要素类。

Feature Class
tag_field
(可选)

将标签属性存储在输出要素类中的字段的名称。默认字段名称为 Tag_Value.

String

代码实例

Tin 面标签 (TinPolygonTag) 示例 1(Python 窗口)

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

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.TinPolygonTag_3d("tin", "tin_polytag.shp", "Tag_Value")
Tin 面标签 (TinPolygonTag) 示例 2(独立脚本)

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

'''****************************************************************************
Name: TinPolygonTag Example
Description: This script demonstrates use of the 
             TinPolygonTag tool to extract tag information 
             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"
    # Set Local Variables
    TagField = "Code"
    # Create list of TINs
    TINList = arcpy.ListDatasets("*", "Tin")
    # Verify the presence of TINs in the list
    if TINList:
        # Iterate through the list of TINs
        for dataset in TINList:
            # Define the name of the output file
            Output = dataset + "_domain.shp"
            # Execute TinPolygonTag
            arcpy.TinPolygonTag_3d(dataset, Output, TagFieldField)
        print "Finished."
    else:
        print "No TIN files reside in {0}".format(env.workspace)
    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)

环境

相关主题

许可信息

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