概化 (Editing)

摘要

使用道格拉斯-普克简化算法和指定的最大偏移容差来简化输入要素。输出要素将包含原始输入折点的子集。

插图

The line is simplified within the boundary of the maximum allowable offset
线在最大可允许偏移界限范围内得到简化

用法

语法

Generalize_edit (in_features, {tolerance})
参数说明数据类型
in_features

要概化的面或线要素。

Feature Layer
tolerance
(可选)

此容差可设定最大允许偏移量,这会确定简化程度。该值会限制输出几何与输入几何的容许偏移距离。可以指定首选测量单位。默认值为要素单位。

Linear unit

代码实例

概化示例(Python 窗口)

以下 Python 窗口脚本演示了如何在即时模式下使用“概化”函数:

import arcpy from arcpy import env env.workspace = "C:\data\data.gdb" arcpy.Generalize_edit("zones", "10 Feet")
概化示例 2(独立脚本)

以下独立脚本是如何在先对要素进行简化再进行缓冲的工作流中使用“概化”函数的示例:

#Name: BufferZones.py #Purpose: Simplify features using the Generalize tool and then Buffer them #Author: ESRI  #Import script modules import arcpy from arcpy import env  try:     #Set the workspace     env.workspace = "C:/data/data.gdb"          #Set local parameters     inFeatures = "zones"     gTolerance = "4 Feet"     copFeatures = "zones_cp"     bufDist = "50 Miles"     bufOutput = "zones_buff"          #Since Generalize permanently updates the input, first make a copy of the original FC     arcpy.CopyFeatures_management (inFeatures, copFeatures)          #Use the Generalize tool to simplify the Buffer input to shorten Buffer processing time     arcpy.Generalize_edit(copFeatures, gTolerance)          #Buffer the output     arcpy.Buffer_analysis(copFeatures, bufOutput, bufDist, "", "", "", "")  except Exception, e:     # If an error occurred, print line number and error message     import traceback, sys     tb = sys.exc_info()[2]     print "Line %i" % tb.tb_lineno     print e.message

环境

相关主题

5/10/2014