栅格转 TIN (3D Analyst)

摘要

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

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

插图

Raster to TIN

用法

语法

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

The input raster.

Raster Layer
out_tin

The output TIN dataset.

TIN
z_tolerance
(可选)

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

Double
max_points
(可选)

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

Long
z_factor
(可选)

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

Double

代码示例

RasterToTIN 示例 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.RasterTin_3d("vermont_ele.tif", "C:/output/TIN_VT", "2", "1000", "1")
RasterToTIN 示例 2(独立脚本)

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

'''*********************************************************************
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

环境

相关主题

许可信息

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

7/10/2012