Erase Point (Editing)
Summary
Deletes points from the input that are either inside or outside the Remove Features, depending on the Operation Type.
Illustration
Usage
-
To delete points inside or on the boundary of the Remove Features, use operation type INSIDE. To delete points outside the Remove Features, use operation type OUTSIDE.
-
For multipoint input features, only points inside or outside the Remove Features will be deleted, depending on the Operation Type.
This tool modifies the input data. See Tools with no outputs for more information and strategies to avoid undesired data changes.
Syntax
Parameter | Explanation | Data Type |
in_features |
The input point features. | Feature layer |
remove_features |
Input features inside or outside the Remove Features will be deleted, depending on the Operation Type parameter. | Feature Layer |
operation_type (Optional) |
Determines if points INSIDE or OUTSIDE the Remove Features will be deleted.
| String |
Code Sample
# Name: ErasePoint_Example.py
# Description: Erase points inside polygon features
# Requirements:
# Author: ESRI
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
The following stand-alone script demonstrates how to use the ErasePoint function.
# Name: ErasePoint_Example2.py
# Description: Replacing low resolution elevation points inside
# lake areas by high resolution lidar points.
# Author: ESRI
# 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")
The following Python window script demonstrates how to use the ErasePoint function in immediate mode.
import arcpy
arcpy.env.workspace = "C:/data"
arcpy.ErasePoint_edit("trees.shp", "park_boundaries", "INSIDE")