删除 Terrain 点 (3D Analyst)

许可等级:BasicStandardAdvanced

摘要

从参与 terrain 数据集的一个或多个要素中删除指定的感兴趣区域内的点。

用法

语法

DeleteTerrainPoints_3d (in_terrain, data_source, polygon_features_or_extent)
参数说明数据类型
in_terrain

输入 terrain 数据集。

Terrain Layer
data_source

点将被移除的一个或多个要素类。

String
polygon_features_or_extent

指定要从中移除点的区域。可使用面要素类或范围。

如果需要范围值,则使用 arcpy.Extent 对象。

Feature Layer; Extent

代码实例

DeleteTerrainPoints 示例 1(Python 窗口)

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

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.DeleteTerrainPoints_3d("sample.gdb/featuredataset/terrain", 
                           "mass_pts_embed", "1379938 235633 1382756 237681")
DeleteTerrainPoints 示例 2(独立脚本)

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

'''**********************************************************************
Name: Delete Terrain Outliers
Description: Uses Locate Outliers to identify outlier points in 
             a terrain dataset, and eliminates the outliers from the 
             terrain with Delete Terrain Points.
**********************************************************************'''
# Import system modules
import arcpy
import exceptions, sys, traceback
from arcpy import env

try:
    arcpy.CheckOutExtension('3D')
    # Set Local Variables
    env.workspace = 'C:/data'
    terrain = 'test.gdb/featuredataset/sample_terrain'
    terrainPt = 'elevation_pts' # name of terrain point data source
    outliers = 'in_memory/outliers'
    # Execute LocateOutliers
    arcpy.ddd.LocateOutliers(terrain, outliers, 'APPLY_HARD_LIMIT', -10, 
                             350, 'APPLY_COMPARISON_FILTER', 1.2, 120, 
                             0.8, 8000)
    # Execute Delete Terrain Points
    arcpy.ddd.DeleteTerrainPoints(terrain, terrainPt, outliers)
    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)

环境

相关主题

许可信息

ArcGIS for Desktop Basic:需要 3D Analyst
ArcGIS for Desktop Standard:需要 3D Analyst
ArcGIS for Desktop Advanced:需要 3D Analyst
9/15/2013