创建 TIN (3D 分析)
摘要
创建 TIN 数据集。
用法
- 
用于表面建模的 TIN 应使用投影坐标系构造。不建议使用地理坐标系。XY 单位是以角度测量来表示(例如,十进制度)时,坡度、体积和通视分析等功能会产生令人误解或不正确的结果。 
- 
当使用对话框时,如果默认列宽过小,您可以调整输入要素类属性对话框的大小以便加大宽度。 
- 
TIN 支持的最大结点数视系统中连续的可用内存资源而定。对于 32 位 Windows 平台而言,正常操作条件下,可达到的最大大小通常为 1000 到 1500 万个结点。但是,应考虑将结点数限制为几百万,以保持足够的可用性和显示功能。最好使用 terrain 来表示更大的数据集。 
语法
| 参数 | 说明 | 数据类型 | 
| out_tin | The output TIN dataset. | TIN | 
| spatial_reference (可选) | 输出 TIN 的空间参考。 | Coordinate System | 
| in_features [[in_feature_class, height_field, SF_type, tag_value],...] (可选) | 将引用添加到要在 TIN 中包含的一个或多个要素类中。对于每个要素类,您都需要设置相应的属性以指明如何使用该要素来定义表面。 in_feature_class:要将其要素导入 TIN 的要素类。 height_field:字段,为要素指定高程值的源。可以使用要素属性表中的任何数值字段。如果要素支持 Z 值,可通过选择 Shape.Z 选项读取要素几何。如果没有所需高度,则指定关键字 <无> 来创建 Z-less 要素,其高程可从表面进行内插。 SF_type:表面要素类型定义从要素导入的几何如何合并到表面的三角测量中。当三角化网格面转换为栅格时,具有硬或软标识的选项表示是否要素边表示坡度中或平缓变化中的明显中断。可用的关键字如下: 
 tag_value:在表面要素类型设置为值填充选项时使用的来自要素类属性表的整型字段。标签填充用作三角形属性的基本形式,其边界在三角测量中强制为隔断线。默认选项设置为 <无>。 | Value Table | 
| constrained_delaunay (可选) | Specifies the triangulation technique used along the breaklines of the TIN. 
 | Boolean | 
代码示例
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.CreateTin_3d("NewTIN", "Coordinate Systems/Projected Coordinate Systems/State Plane/NAD 1983 (Feet)/NAD 1983 StatePlane California II FIPS 0402 (Feet).prj", "points.shp Shape.Z masspoints", "constrained_delaunay")
The following sample demonstrates the use of this tool in a stand-alone Python script:
'''****************************************************************************
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)