擦除 (Analysis)

许可等级:BasicStandardAdvanced

摘要

通过将输入要素擦除要素的多边形相叠加来创建要素类。只将输入要素处于擦除要素外部边界之外的部分复制到输出要素类。

插图

Erase illustration

用法

语法

Erase_analysis (in_features, erase_features, out_feature_class, {cluster_tolerance})
参数说明数据类型
in_features

输入要素类或图层。

Feature Layer
erase_features

用于擦除重叠输入要素的要素。

Feature Layer
out_feature_class

该要素类只包含与“擦除要素”不重叠的“输入要素”。

Feature Class
cluster_tolerance
(可选)

所有要素坐标(结点和折点)之间的最小距离以及坐标可以沿 X 和/或 Y 方向移动的距离。

Linear unit

代码实例

擦除 (Erase) 示例(Python 窗口)

以下 Python 窗口脚本演示了如何在即时模式下使用擦除 (Erase) 函数。

import arcpy
from arcpy import env
env.workspace = "C:/data/data/gdb"
arcpy.Erase_analysis(r'redlands.gdb\rdlswells\well',r'redlands.gdb\rdlsfloodzones\flood',r'redlands.gdb\wellsoutside_flood','#')
擦除 (Erase) 示例(独立脚本)

查找尚未被主要道路充斥的相应植被区域。

# Name: Erase.py
# Description: Find areas of suitable vegetation which exclude areas heavily impacted by major roads
# Author: ESRI

# import system modules 
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data/Habitat_Analysis.gdb"

# Select suitable vegetation patches from all vegetation
veg = "vegtype"
suitableVeg = "C:/output/Output.gdb/suitable_vegetation"
whereClause = "HABITAT = 1" 
arcpy.Select_analysis(veg, suitableVeg, whereClause)

# Buffer areas of impact around major roads
roads = "majorrds"
roadsBuffer = "C:/output/Output.gdb/buffer_output"
distanceField = "Distance"
dissolveField = "Distance"
arcpy.Buffer_analysis(roads, roadsBuffer, distanceField, "FULL", "ROUND", "LIST", dissolveField)

# Erase areas of impact around major roads from the suitable vegetation patches
eraseOutput = "C:/output/Output.gdb/suitable_vegetation_minus_roads"
xyTol = "1 Meters"
arcpy.Erase_analysis(suitableVeg, roadsBuffer, eraseOutput, xyTol)

环境

相关主题

许可信息

ArcGIS for Desktop Basic:否
ArcGIS for Desktop Standard:否
ArcGIS for Desktop Advanced:是
9/15/2013