容差 (Coverage)

许可等级:BasicStandardAdvanced

摘要

设置 coverage 的容差。

了解有关“容差”工作原理的详细信息

用法

语法

Tolerance_arc (in_cover, {tolerance_type}, {tolerance_value})
参数说明数据类型
in_cover

要设置容差的 coverage。

Coverage
tolerance_type
(可选)

要设置的容差类型。

  • FUZZY将输入 Coverage 的模糊容差设置为“容差值”中所指定的值。这是默认选项。
  • DANGLE将输入 Coverage 的悬挂长度设置为“容差值”中所指定的值。
  • TIC_MATCH将控制点匹配容差设置为“容差值”中所指定的值。
  • EDIT将输入 Coverage 的编辑距离设置为“容差值”中所指定的值。
  • NODESNAP将输入 Coverage 的结点捕捉距离设置为“容差值”中所指定的值。
  • WEED将去点容差设置为“容差值”中所指定的值。
  • GRAIN将颗粒容差设置为“容差值”中所指定的值。
  • SNAP将输入 Coverage 的常规捕捉距离设置为“容差值”中所指定的值。
String
tolerance_value
(可选)

要为所选选项的容差设置的值。以下选项不接受零“容差值”:FUZZY、EDIT、NODESNAP、WEED、GRAIN 和 SNAP。

Double

代码实例

容差独立脚本

以下独立脚本演示了如何使用“容差”工具。该脚本使用 Describe 检查工作空间中所有 coverage 的容差。如果所有容差都不符合预先确定的标准,该脚本将使用“容差”工具来更新这些容差。

# Name: Tolerance_Example.py
# Description: Checks/updates tolerances on all coverages in a workspace.
# Requirements: ArcInfo Workstation

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# set the tolerance standards
fuzzyValue      =    1.0
dangleValue     =    0.0
tic_matchValue  =    0.0
editValue       =  100.0
nodesnapValue   =   10.0
weedValue       =   10.0
grainValue      =   10.0
snapValue       =   10.0

coverageList = arcpy.ListDatasets("*", "coverage")

for cov in coverageList:
    desc = arcpy.Describe(cov)

    if desc.tolerances.fuzzy <> fuzzyValue:
        arcpy.Tolerance_arc(cov, "fuzzy", fuzzyValue)

    if desc.tolerances.dangle <> dangleValue:
        arcpy.Tolerance_arc(cov, "dangle", dangleValue)

    if desc.tolerances.ticmatch <> tic_matchValue:
        arcpy.Tolerance_arc(cov, "tic_match", tic_matchValue)            

    if desc.tolerances.edit <> editValue:
        arcpy.Tolerance_arc(cov, "edit", editValue)            

    if desc.tolerances.nodesnap <> nodesnapValue:
        arcpy.Tolerance_arc(cov, "nodesnap", nodesnapValue)           

    if desc.tolerances.weed <> weedValue:
        arcpy.Tolerance_arc(cov, "weed", weedValue)            

    if desc.tolerances.grain <> grainValue:
        arcpy.Tolerance_arc(cov, "grain", grainValue)            

    if desc.tolerances.snap <> snapValue:
        arcpy.Tolerance_arc(cov, "snap", snapValue)

环境

相关主题

许可信息

ArcGIS for Desktop Basic:否
ArcGIS for Desktop Standard:否
ArcGIS for Desktop Advanced:需要 已安装 ArcInfo Workstation
9/15/2013