栅格转 TIN (3D Analyst)

许可等级:BasicStandardAdvanced

摘要

将栅格转换为不规则三角网 (TIN) 数据集。

了解有关“栅格转 TIN”工作原理的详细信息

插图

Raster to TIN

用法

语法

RasterTin_3d (in_raster, out_tin, {z_tolerance}, {max_points}, {z_factor})
参数说明数据类型
in_raster

输入栅格。

Raster Layer
out_tin

输出 TIN 数据集。

TIN
z_tolerance
(可选)

输入栅格与输出 TIN 之间所允许的最大高度差(z 单位)。默认情况下,z 容差是输入栅格 z 范围的 1/10。

Double
max_points
(可选)

将在处理过程终止前添加到 TIN 的最大点数。默认情况下,该过程将一直持续到所有点被添加完。

Long
z_factor
(可选)

在生成的 TIN 数据集中与栅格的高度值相乘的因子。此值通常用于转换 Z 单位来匹配 XY 单位。

Double

代码实例

RasterTin 示例 1(Python 窗口)

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

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.RasterTin_3d("vermont_ele.tif", "C:/output/TIN_VT", "2", "1000", "1")
RasterTin 示例 2(独立脚本)

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

'''*********************************************************************
Name: RasterTin Example
Description: This script demonstrates how to use the 
             RasterTin tool to create a TIN for each IMG raster in the 
             target workspace.
**********************************************************************'''

# Import system modules
import arcpy
from arcpy import env

# Obtain a license for the ArcGIS 3D Analyst extension
arcpy.CheckOutExtension("3D")

# Set environment settings
env.workspace = "C:/data"

try:
    # Create the list of IMG rasters
    rasterList = arcpy.ListRasters("*", "IMG")
    # Loop the process for each raster
    if rasterList:
        for raster in rasterList:
            # Set Local Variables
            zTol = 2
            maxPts = 1500000
            zFactor = 1
            # [:-4] strips the last 4 characters (.img) from the raster name
            outTin = "C:/Output/TIN_" + raster[:-4] 
            print "Creating TIN from " + raster + "."
            #Execute RasterTin
            arcpy.RasterTin_3d(raster, outTIN, zTol, maxPts, zFactor)
        print "Finished."
    else:
        "There are no IMG rasters in the " + env.workspace + " directory."
except Exception as e:
    # Returns any other error messages
    print e.message

环境

相关主题

许可信息

ArcGIS for Desktop Basic: 需要 3D Analyst
ArcGIS for Desktop Standard: 需要 3D Analyst
ArcGIS for Desktop Advanced: 需要 3D Analyst
5/10/2014