平滑面 (制图)

摘要

对面轮廓中的尖角进行平滑处理以使制图更加美观或改善制图质量。

插图

Smooth Polygon illustration

用法

语法

SmoothPolygon_cartography (in_features, out_feature_class, algorithm, tolerance, {endpoint_option}, {error_option})
参数说明数据类型
in_features

要平滑处理的面要素。

Feature Layer
out_feature_class

要创建的输出面要素类。

Feature Class
algorithm

指定平滑算法。

  • PAEKPolynomial Approximation with Exponential Kernel(指数核的多项式近似)的首字母缩略词。该方法可以计算不经过输入面折点的平滑面。这是默认设置。
  • BEZIER_INTERPOLATION拟合折点间的贝塞尔曲线。生成的面将经过输入面的折点。该算法不需要容差。在 shapefile 输出中,将创建近似的贝塞尔曲线。
String
tolerance

设置 PAEK 算法使用的容差。必须指定一个容差,且值必须大于零。可以指定首选单位;默认为要素单位。使用 BEZIER_INTERPOLATION 平滑算法时,必须输入 0 作为占位符。

Linear unit
endpoint_option
(可选)

指定是否保留孤立面环的端点。该选项仅适用于 PAEK 算法。

  • FIXED_ENDPOINT保留孤立面环的端点。这是默认设置。
  • NOT_FIXED通过孤立面环的端点进行平滑处理。
Boolean
error_option
(可选)

指定如何处理拓扑错误(可能是在该过程中引发的,如线的交叉或重叠)。

  • NO_CHECK指定不检查拓扑错误。这是默认设置。
  • FLAG_ERRORS指定标记拓扑错误(如果发现拓扑错误)。
String

代码示例

SmoothPolygon 示例(Python 窗口)

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

import arcpy from arcpy import env import arcpy.cartography as CA env.workspace = "C:/data" CA.SmoothPolygon("soils.shp", "C:/output/output.gdb/smoothed_soils", "PAEK", 100)
SmoothPolygon 示例 2(独立脚本)

以下独立脚本演示了如何使用 SmoothPolygon 工具。

# Name: SmoothPolygon_Example2.py # Description: Eliminate small islands before simplifying and smoothing lake boundaries # Author: ESRI   # Import system modules import arcpy from arcpy import env import arcpy.cartography as CA import arcpy.management as DM   # Set environment settings env.workspace = "C:/data/Portland.gdb/Hydrography"   # Set local variables inLakeFeatures = "lakes" eliminatedFeatures = "C:/data/PortlandOutput.gdb/lakes_eliminated" simplifiedFeatures = "C:/data/PortlandOutput.gdb/lakes_simplified" smoothedFeatures = "C:/data/PortlandOutput.gdb/lakes_smoothed"  # Eliminate small islands in lake polygons. DM.EliminatePolygonPart(inLakeFeatures, eliminatedFeatures, 100, "OR", 0, "CONTAINED_ONLY")   # Simplify lake polygons. CA.SimplifyPolygon(eliminatedFeatures, simplifiedFeatures, "POINT_REMOVE", 50, 200, "RESOLVE_ERRORS", "KEEP_COLLAPSED_POINTS", "CHECK")   # Smooth lake polygons. CA.SmoothPolygon(simplifiedFeatures, smoothedFeatures, "PAEK", 100, "FLAG_ERRORS")   

环境

相关主题

许可信息

ArcView: 否
ArcEditor: 是
ArcInfo: 是

7/10/2012