描绘 TIN 数据区 (3D Analyst)

许可等级:BasicStandardAdvanced

摘要

基于三角形的边长度重新定义不规则三角网 (TIN) 的数据区或内插区。

插图

Delineate tin data area illustration

用法

语法

DelineateTinDataArea_3d (in_tin, max_edge_length, {method})
参数说明数据类型
in_tin

输入 TIN。

TIN Layer
max_edge_length

用于在 TIN 数据区中定义 TIN 三角形边的最大长度的二维距离。如果三角形的一个或多个边大于此值,则会将其视为处于 TIN 插值区之外,并且不会在地图中进行渲染或用于表面分析。

Double
method
(可选)

用来描绘 TIN 数据区的方法。

  • PERIMETER_ONLY从 TIN 的外部范围向内遍历各个三角形,如果边界三角形的边在当前迭代中小于最大边长,则将停止遍历。这是默认设置。
  • ALL按边长对整个 TIN 三角形集合进行分类。
String

代码实例

DelineateTinDataArea 示例 1(Python 窗口)

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

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.DelineateTinDataArea_3d("elevation", 10, "PERIMETER_ONLY")
DelineateTinDataArea 示例 2(独立脚本)

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

'''****************************************************************************
Name: Define Data Boundary of LAS File
Description: This script demonstrates how to delineate data boundaries of 
             LAS files with irregularly clustered points. It is intended for 
             use as a script tool with one input LAS file.
****************************************************************************'''
# Import system modules
import arcpy
import exceptions, sys, traceback

# Set local variables
inLas = arcpy.GetParameterAsText(0) #input LAS file
ptSpacing = arcpy.GetParameterAsText(1) # LAS point spacing
classCode = arcpy.GetParameterAsText(2) # List of integers
returnValue = arcpy.GetParameterAsText(3) # List of strings
outTin = arcpy.GetParameterAsText(4) # TIN created to delineate data area
outBoundary = arcpy.GetParameterAsText(5) # Polygon boundary file

try:
    arcpy.CheckOutExtension("3D")
    # Execute LASToMultipoint
    arcpy.AddMessage("Creating multipoint features from LAS...")
    lasMP = arcpy.CreateUniqueName('lasMultipoint', 'in_memory')
    arcpy.ddd.LASToMultipoint(inLas, LasMP, ptSpacing, class_code, 
                             "ANY_RETURNS", "", sr, inFormat, zfactor)
    # Execute CreateTin
    arcpy.AddMessage("Creating TIN dataset...")
    arcpy.ddd.CreateTin(outTin, sr, "{0} Shape.Z masspoints"\
                       .format(lasMP), "Delaunay")
    # Execute CopyTin
    arcpy.AddMessage("Copying TIN to delineate data boundary...")
    arcpy.ddd.CopyTin(outTin, "{0}_copy".format(outTin))
    # Execute DelineateTinDataArea
    arcpy.AddMessage("Delineating TIN boundary...")
    maxEdge = ptSpacing * 4
    arcpy.ddd.DelineateTinDataArea(outTin, maxEdge, "PERIMETER_ONLY")
    # Execute TinDomain
    arcpy.AddMessage("Exporting data area to polygon boundary...")
    arcpy.ddd.TinDomain(outTin, outBoundary, "POLYGON")
    arcpy.AddMessage("Finished")
    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