arcgis更新注记要素类

 

arcgis更新注记要素类

描述

此工具可使用文本属性字段更新输入注记要素类以及为要素类中的每个要素填充新字段的值(可选)。

使用方法

  • 如果未选中填充属性字段的选项,则此工具可在版本化的要素类上运行。在这种情况下,将更新要素类的方案,但不会填充新的注记字段。在对要素进行编辑之前,此要素的属性值将一直为空。
  • 此工具将更新要素类的方案以及要素类中的每个注记要素(可选)。方案更新将向要素类中添加字段(粗体、斜体和文本等),并且还会确保符号集合中有符号存在。如果符号集合中没有符号,则您在构建注记要素时将无法应用各种改进。
  • 填充属性字段是一种资源消耗很大的操作,它会对所有要素进行更新。关闭此选项可以添加字段但不进行填充。如果更新时未填充字段,则在对要素进行编辑之前,这些字段将一直为空。

语法

UpdateAnnotation(in_features, {update_values})

参数

说明

数据类型

in_features

要将新字段添加到的输入注记要素类。

Feature Layer

update_values

(可选)

为要素类中每个要素的每个新字段填充值。

  • POPULATE —为要素类中每个要素的每个新字段填充值。
  • DO_NOT_POPULATE —不填充字段值。

Boolean

代码示例

UpdateAnnotation 示例(Python 窗口)

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

import arcpy

arcpy.env.workspace = "C:/data/Ontario.mdb"

arcpy.UpdateAnnotation_management("ProvParks_anno", "POPULATE")

UpdateAnnotation 示例(独立 python 脚本)

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

# Name: UpdateAnnotation_Example.py

# Description: Use UpdateAnnotation to update ArcGIS 8.3 annotation feature classes

# to ArcGIS 9.0

 

# import system modules

import arcpy

import os

 

# Set environment settings

# User input geodatabase location - eg. C:/data/anno83.mdb

arcpy.env.workspace = input('Annotation data location: ')

 

# Create list of annotation feature classes within the geodatabase

fcList = arcpy.ListFeatureClasses("", "ANNOTATION")

 

# Loop through the feature classes and update

for fc in fcList:

try:

# Process: Update the annotation feature classes

print("Updating " + fc + "...")

arcpy.UpdateAnnotation_management(fc, "POPULATE")

except:

# If an error occurred while running a tool print the messages

print(arcpy.GetMessages())

 

print("Update of annotation feature classes in " + env.workspace + " complete")

原文地址:https://www.cnblogs.com/xiexiaokui/p/13795937.html