擦除点 (Editing)

摘要

从输入中删除移除要素之内或之外的点,具体取决于操作类型

插图

Erase Point Illustration

用法

语法

ErasePoint_edit (in_features, remove_features, {operation_type})
参数说明数据类型
in_features

输入点要素。

Feature Layer
remove_features

将删除“移除要素”之内或之外的输入要素,具体取决于“操作类型”参数。

Feature Layer
operation_type
(可选)

确定是删除“移除要素”之内还是之外的点。

  • INSIDE将删除“移除要素”内部或边界上的输入点要素。
  • OUTSIDE将删除“移除要素”之外的输入点要素。
String

代码实例

ErasePoint 示例 1(独立脚本)
# Name: ErasePoint_Example.py
# Description: Erase points inside polygon features

import arcpy
from arcpy import env
env.workspace="C:/data"
inFeatures="wells.shp"
removeFeatures="land.shp"
operationType="INSIDE"
try:
    arcpy.ErasePoint_edit(inFeatures, removeFeatures, operationType)
except Exception, e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "Line %i" % tb.tb_lineno
    print e.message
ErasePoint 示例 2(独立脚本)

以下独立脚本演示了如何使用 ErasePoint 函数。

# Name: ErasePoint_Example2.py
# Description: Replacing low resolution elevation points inside 
# lake areas by high resolution lidar points.
 
# Import system modules
import arcpy
from arcpy import env
 
# Set environment settings
env.workspace = "C:/data/Portland.gdb/relief"
 
# Set local variables
inElevationFeatures = "elevation_points"
inLidarFeatures = "lidar_points"
inLakeFeatures = "lakes"
 
# Erase elevation points inside lakes
arcpy.ErasePoint_edit(inElevationFeatures, inLakeFeatures, "INSIDE")

# Clip lidar points inside lakes
arcpy.ErasePoint_edit(inLidarFeatures, inLakeFeatures, "OUTSIDE")
  
# Append the clipped lidar points to the remaining elevation points
arcpy.Append_management(inElevationFeatures, inLidarFeatures, "NO_TEST")
ErasePoint 示例(Python 交互式窗口)

以下 Python 窗口脚本演示了如何在立即模式下使用 ErasePoint 函数。

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.ErasePoint_edit("trees.shp", "park_boundaries", "INSIDE")

环境

相关主题

5/10/2014