摘要

通过将面与具有最大面积或最长公用边界的邻近面合并来消除面。消除通常用于移除叠加操作(如相交或联合)所生成的小的狭长面。

插图

用法

  • 要消除的要素由应用于面图层的选择内容决定。必须在之前的步骤中使用[按属性选择图层]或[按位置选择图层]或者通过查询 ArcMap 中的地图图层来确定选择内容。
  • 通过删除公用边界来仅将所选面与邻近的未选定面进行合并。所选面将不与邻近的选定面合并。
  • 输入图层必须包含选择内容;否则,消除将失败。
  • 排除表达式和排除图层不会相互排斥,可将二者结合使用以对要消除的要素进行全面控制。

语法

1
Eliminate_management (in_features, out_feature_class, {selection}, {ex_where_clause}, {ex_features})
参数 说明 数据类型
in_features 其中的面将与邻近面进行合并的图层。 Feature Layer
out_feature_class 待创建的要素类。 Feature Class
selection(可选) 这些选项可指定将要使用的消除要素的方法。LENGTH —通过删除公用边界将所选面与邻近的未选定面合并。该邻近面的公用边界最长。这是默认设置。AREA —通过删除公用边界将所选面与邻近的未选定面合并。该邻近面的面积最大。 Boolean
ex_where_clause(可选) 用于识别不会被更改的要素的 SQL 表达式。 SQL Expression
ex_features(可选) 定义不应被消除的面边界(或部分)的输入折线 (polyline)、面要素类或图层。 Feature Layer

代码实例

消除示例(Python 窗口)

以下 Python 窗口脚本演示了如何在即时模式下使用“消除”工具。

1
2
3
4
5
6
7
import arcpy
arcpy.env.workspace = "C:/data/Portland.gdb/Census"
arcpy.MakeFeatureLayer_management("blockgrp", "blocklayer")
arcpy.SelectLayerByAttribute_management("blocklayer", "NEW_SELECTION",
'"Area_Sq_Miles" < 0.15')
arcpy.Eliminate_management("blocklayer", "C:/output/output.gdb/eliminate_output",
"LENGTH", '"OBJECTID" = 9')

消除示例 2(独立脚本)

以下独立脚本演示了如何使用“消除”工具。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Name: Eliminate_Example2.py
# Description: Eliminate features based on a selection.

# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = "C:/data/Portland.gdb/Census"

# Set local variables
inFeatures = "blockgrp"
tempLayer = "blocklayer"
expression = '"Area_Sq_Miles" < 0.15'
outFeatureClass = "C:/output/output.gdb/eliminate_output"
exclusionExpression = '"OBJECTID" = 9'

# Execute MakeFeatureLayer
arcpy.MakeFeatureLayer_management(inFeatures, tempLayer)

# Execute SelectLayerByAttribute to define features to be eliminated
arcpy.SelectLayerByAttribute_management(tempLayer, "NEW_SELECTION", expression)

# Execute Eliminate
arcpy.Eliminate_management(tempLayer, outFeatureClass, "LENGTH",
exclusionExpression)

了解更多

要了解更多关于ArcMap的知识请参阅以下链接:

最后更新: 2018年03月25日 15:16

原始链接: http://rickeryan.tk/2017/03/24/ArcMap-Ploygon-Eliminate/

× 打赏作者~
打赏二维码