Terrain 转点 (3D Analyst)
摘要
将 terrain 数据集转换为一个新的点或多点要素类。
插图
用法
- 针对指定的金字塔等级分辨率和感兴趣区提取点。
- 如果指定了嵌入式要素类,则输出点将仅来自嵌入式要素。否则,将从构成 terrain 表面的所有点派生输出点。
如果某个嵌入式要素包含激光雷达属性,例如 RGB、分类或返回值,属性将被写入输出要素类。不过,属性的写入方式取决于所指定的几何类型:
- MULTIPOINT - 属性将存储在 BLOB 字段中。
- POINT - 属性将存储在数值型字段中。
有关嵌入式要素的详细信息,请阅读嵌入式要素类。
语法
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 (可选) |
输出要素类的几何类型。
| 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