ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS for Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

Fill Gaps

获得 Production Mapping 许可后可用。

  • 摘要
  • 插图
  • 用法
  • 语法
  • 代码示例
  • 环境
  • 许可信息

摘要

Many types of polygon features should have coincident boundaries with other features. Coincident boundaries may be important for features within a single polygon feature class, such as parcels, or between features in different feature classes, such as lakes and surrounding vegetation. A gap between the features exists when there is space between the boundaries of two or more features.

插图

Example of Fill Gaps functionality

用法

    警告:

    此工具会修改输入数据。有关详细信息以及避免数据被意外更改的策略,请参阅不创建输出数据集的工具。

  • If this tool is run in an edit session in ArcMap, you can stop the edit session without saving changes to restore features that have been modified.

  • The order of the entries in the Input Polygon Features list is important when the Fill Options parameter is set to FILL_BY_ORDER. For instance, if vegetation is first in the list, and lakes are the second input polygons when FILL_BY_ORDER is selected, the vegetation features will always be adjusted to fill the gap. If the order is reversed and lakes appear first in the list, the lake features will always be adjusted to fill the gap.

  • When multiple compare feature layers are provided and the Fill Options parameter is set to FILL_BY_LENGTH, the area of the gap is added to the feature class that shares the longest boundary with the gap. For instance, if the gap shares a longer boundary with feature layer A and a shorter boundary with feature layer B, the area of the gap will be added to the feature in feature class A.

  • This tool requires one or more input feature classes. If only one input feature class is specified, the tool will look for gaps between individual features in that feature class. When multiple feature classes are specified, the tool will look for gaps between all features in all the input feature classes. The tool will find gaps between two features in the same feature class as well as gaps between features in the different feature classes.

  • When looking for gaps between multiple feature classes, add all of the feature classes as input polygons. For example, if there should be no gaps between features in the lakes, grass, and forest feature classes, add them all in the Input Polygon Features parameter. If you just add lakes and forests, the tool may identify a gap between lakes and forests and fill the gap. However, the area that was identified as a gap may have had a grass feature which will result in the modified feature overlapping the grass. To prevent possible overlaps, add all feature classes into the Input Polygon Features parameter.

  • Unenclosed gaps exist when two polygon boundaries are within a specified distance to each other. The two polygon features do not have to touch each other at any point.

  • When the Fill Unenclosed Gaps option is checked, the unenclosed gaps will be filled first. After unenclosed gaps are filled, then enclosed gaps will be filled.

  • Enclosed gaps exist when there are gaps between two polygon boundaries.

  • This tool does not fill self-gaps. If a feature is a multipart feature or a feature with holes, the tool will not fill the holes or gaps between the parts.

语法

FillGaps(in_polygon_features, maximum_gap_area, fill_options, {fill_unenclosed_gaps}, {maximum_gap_distance})
参数说明数据类型
in_polygon_features
[in_polygon_features,...]

The polygon features analyzed for gaps. This tool searches for gaps between these features based on the spatial relationships between them.

Feature Layer
maximum_gap_area

The maximum area that can be considered a gap. If the area in question is above this set threshold, it will not be filled.

Areal unit
fill_options

Indicates how the tool fills enclosed and unenclosed gaps.

  • FILL_BY_LENGTH —Fills the gap by adding the gap's geometry to the polygon with the longest shared edge. This is the default.
  • FILL_BY_ORDER —Fills sequentially according to the order of the Input Polygon Features list.
String
fill_unenclosed_gaps
(可选)

Indicates if the tool will fill unenclosed gaps.

  • FILL_ENCLOSED_ONLY —The tool will fill enclosed gaps only. This is the default.
  • FILL_ALL —The tool will fill enclosed and unenclosed gaps.
Boolean
maximum_gap_distance
(可选)

Maximum distance between features in which a gap can be filled. Used only when Fill Unenclosed Gaps is enabled.

Linear Unit

代码示例

FillGaps example 1 (stand-alone script)

The following stand-alone sample script demonstrates how to use FillGaps for enclosed features.

# Name: FillGapsExample_1.py
# Description: Fills gaps between features
# Author: Esri
# Date: March 2015

# Import arcpy module
import arcpy

# Import toolbox
arcpy.ImportToolbox(r'C:\Program Files (x86)\ArcGIS\EsriProductionMapping\Desktop10.3\ArcToolbox\Toolboxes\Production Mapping Tools.tbx')

# Check out Production Mapping license
arcpy.CheckOutExtension("Foundation")

# Set environment
worksp = "C:\data\FillGaps.gdb"

# Define variables
inPoly1 = "C:\data\FillGaps.gdb\BuiltupA"
inPoly2 = "C:\data\FillGaps.gdb\LakeresA"
inPoly3 = "C:\data\FillGaps.gdb\PolbndA"
max_gap = "700000 SquareMeters"
fill_options = "FILL_BY_LENGTH"
fill_unenclosed_gaps = "FILL_ENCLOSED_ONLY"

# Create feature layer for input features
arcpy.MakeFeatureLayer_management(inPoly1,"inBuiltupLyr")
arcpy.MakeFeatureLayer_management(inPoly2,"inLakeResLyr")
arcpy.MakeFeatureLayer_management(inPoly3,"inPolbndLyr")

# Fill gaps between the different layers
arcpy.FillGaps_production("inBuiltupLyr;inLakeResLyr;inPolbndLyr",max_gap, fill_options, fill_unenclosed_gaps)

# Check in Production Mapping license
arcpy.CheckInExtension("Foundation")
FillGaps example 2 (stand-alone script)

The following stand-alone sample script demonstrates how to use FillGaps for unenclosed features.

# Name: FillGapsExample_2.py
# Description: Fills gaps between features
# Author: Esri
# Date: March 2015

# Import arcpy module
import arcpy

# Import toolbox
arcpy.ImportToolbox(r'C:\Program Files (x86)\ArcGIS\EsriProductionMapping\Desktop10.3\ArcToolbox\Toolboxes\Production Mapping Tools.tbx')

# Check out Production Mapping license
arcpy.CheckOutExtension("Foundation")

# Set environment
worksp = "C:\data\FillGaps.gdb"

# Define variables
inPoly1 = "C:\data\FillGaps.gdb\BuiltupA"
inPoly2 = "C:\data\FillGaps.gdb\LakeresA"
inPoly3 = "C:\data\FillGaps.gdb\PolbndA"
max_gap = "700000 SquareMeters"
fill_options = "FILL_BY_LENGTH"
fill_unenclosed_gaps = "FILL_ALL"
max_gap_distance = "20 Meters"

# Create feature layer for input features
arcpy.MakeFeatureLayer_management(inPoly1,"inBuiltupLyr")
arcpy.MakeFeatureLayer_management(inPoly2,"inLakeResLyr")
arcpy.MakeFeatureLayer_management(inPoly3,"inPolbndLyr")

# Fill gaps between the different layers
arcpy.FillGaps_production("inBuiltupLyr;inLakeResLyr;inPolbndLyr",max_gap, fill_options, fill_unenclosed_gaps, max_gap_distance)

# Check in Production Mapping license
arcpy.CheckInExtension("Foundation")

环境

  • 当前工作空间
  • 临时工作空间

许可信息

  • ArcGIS Desktop Basic: 否
  • ArcGIS Desktop Standard: 需要 Production Mapping
  • ArcGIS Desktop Advanced: 需要 Production Mapping

相关主题

  • An overview of the Editing toolset
  • Repair Bad Geometry

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS 平台

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2019 Esri. | 隐私政策 | 法律声明