Terrain 转点 (3D Analyst)

摘要

将 terrain 数据集转换为一个新的点或多点要素类。

插图

Terrain to Points Example

用法

语法

TerrainToPoints_3d (in_terrain, out_feature_class, {pyramid_level_resolution}, {source_embedded_feature_class}, {out_geometry_type})
参数说明数据类型
in_terrain

The input terrain dataset.

Terrain Layer
out_feature_class

The output feature class.

Feature Class
pyramid_level_resolution
(可选)

The z-tolerance or window size resolution of the terrain pyramid level that will be used by this tool. The default is 0, or full resolution.

Double
source_embedded_feature_class
(可选)

要导出的 terrain 数据集嵌入点的名称。如果指定一个嵌入要素,则只有来自该要素的点会写入到输出。否则,将会导出参与 terrain 的所有数据源中的全部点。

String
out_geometry_type
(可选)

输出要素类的几何类型。

  • MULTIPOINT输出点要素将被写入一个多点要素类。这是默认设置。
  • POINT输出点要素将被写入一个点要素类。
String

代码示例

Terrain 转点 (TerrainToPoints) 示例 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.TerrainToPoints_3d("sample.gdb/featuredataset/terrain", "terrain_points.shp", "6", "<NONE>", "POINT")
Terrain 转点 (TerrainToPoints) 示例 2(独立脚本)

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

'''*****************************************************************
Name: TerrainToPoints Example
Description: This script demonstrates how to use the 
             TerrainToPoints tool.
*****************************************************************'''
# 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
    terrain = "sample.gdb/featuredataset/terrain"
    outPts = arcpy.CreateUniqueName("terrain_pts", "sample.gdb")
    outGeo = "POINT"
    # Execute TerrainToPoints
    arcpy.ddd.TerrainToPoints(terrain, outPts, 6, "<NONE>", outGeo)

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)

环境

相关主题

许可信息

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

7/10/2012