聚合面 (制图)

摘要

将指定距离内的面合并成新的面要素。

插图

Aggregate Polygons illustration

用法

语法

AggregatePolygons_cartography (in_features, out_feature_class, aggregation_distance, {minimum_area}, {minimum_hole_size}, {orthogonality_option})
参数说明数据类型
in_features

要聚合的面要素。

Feature Layer
out_feature_class

要创建的输出要素类。

Feature Class
aggregation_distance

聚合时面要素边界间要满足的距离。必须指定一个距离,且此距离必须大于零。可以选择首选单位;默认为要素单位。

Linear unit
minimum_area
(可选)

聚合面得以保留的最小面积。默认值为零,即保留所有面。可以指定首选单位;默认为要素单位。

Areal unit
minimum_hole_size
(可选)

面洞得以保留的最小大小。默认值为零,即保留所有面洞。可以指定首选单位;默认为要素单位。

Areal Unit
orthogonality_option
(可选)

指定构造聚合边界时输出要素的特征。

  • NON_ORTHOGONAL将创建有机形状的输出要素。这适用于自然要素,例如,植被或土壤多边形。这是默认设置。
  • ORTHOGONAL将创建正交形状的输出要素。此选项适用于保留人为输入要素的几何特性,例如,建筑物覆盖区。
Boolean

代码示例

AggregatePolygons 工具示例 1(Python 窗口)

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

import arcpy
from arcpy import env
import arcpy.cartography as CA
env.workspace = "C:/data"
CA.AggregatePolygons("buildings.shp", "C:/output/output.gdb/aggregated_buildings", 10)
AggregatePolygons 工具示例 2(独立脚本)

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

# Name: AggregatePolygons_Example2.py
# Description: Aggregate grass features and then transfer attributes
 
# Import system modules
import arcpy
from arcpy import env
import arcpy.cartography as CA
import arcpy.management as DM
import arcpy.analysis as AN
  
# Set environment settings
env.workspace = "C:/data/Portland.gdb/Vegetation"
 
# Set local variables
inGrassFeatures = "grass"
aggregatedFeatures = "C:/data/PortlandOutput.gdb/grassland"
aggregatedTable = "C:/data/PortlandOutput.gdb/grassland_Tbl"
frequencyTable = "C:/data/PortlandOutput.gdb/frequency_Tbl"

# Aggregate grass polygons.
CA.AggregatePolygons(inGrassFeatures, aggregatedFeatures, 50, 300, 300, "NON_ORTHOGONAL")
 
# Join the aggregatedTable with input and
# transfer the COUNT field to aggregatedTable.
DM.JoinField(aggregatedTable, "INPUT_FID", inGrassFeatures, "OBJECTID", "COUNT")
 
# Use Frequency on aggregatedTable and
# obtain sum for COUNT.
AN.Frequency(aggregatedTable, frequencyTable, "OUTPUT_FID", "COUNT")

# Join the aggregatedFeatures with frequencyTable
# and transfer the COUNT field to aggregatedFeatures.
DM.JoinField(aggregatedFeatures, "OBJECTID", frequencyTable, "OUTPUT_FID", "COUNT")

环境

相关主题

许可信息

ArcView: 否
ArcEditor: 否
ArcInfo: 是

7/10/2012