Tiled Labels To Annotation (Cartography)

Summary

Converts labels to annotation for layers in a map document based on a polygon index layer.

The tool divides a map into tiles and creates annotation for each tile in turn. This is useful for converting a large number of labels to annotation. The polygon index layer can be one generated by the Map Server Cache Tiling Scheme To Polygons or Grid Index Features tools or any other polygon feature class that covers the area where you would like to create annotation.

Usage

Syntax

TiledLabelsToAnnotation_cartography (map_document, data_frame, polygon_index_layer, out_geodatabase, out_layer, anno_suffix, {reference_scale_value}, {reference_scale_field}, {tile_id_field}, {coordinate_sys_field}, {map_rotation_field}, {feature_linked}, {generate_unplaced_annotation})
ParameterExplanationData Type
map_document

The source map document that contains the labels to convert to annotation.

ArcMap Document
data_frame

The data frame from the map document that contains the labels to convert to annotation.

String
polygon_index_layer

The polygon layer that contains tile features.

Table View
out_geodatabase

The workspace where the output feature classes will be saved. The workspace can be an existing geodatabase or an existing feature dataset.

Workspace ;Feature Dataset
out_layer

The group layer that will contain the generated annotation. When working in ArcCatalog, you can use the Save To Layer File tool to write the output group layer to a layer file. When using ArcMap, the tool adds the group layer to the display if this option is checked in the geoprocessing options. The group layer that is created is temporary and will not persist after the session ends unless the document is saved.

Group Layer
anno_suffix

The suffix that will be added to each new annotation feature class. This suffix will be appended to the name of the source feature class for each new annotation feature class. The reference scale for the annotation will follow this suffix.

String
reference_scale_value
(Optional)

Enter the scale to use as a reference for the annotation. This sets the scale to which all symbol and text sizes in the annotation will be based.

Double
reference_scale_field
(Optional)

The field in the polygon index layer that will determine the reference scale of the annotation. This sets the scale to which all symbol and text sizes in the annotation will be based.

Field
tile_id_field
(Optional)

A field in the polygon index layer that uniquely identifies the tiled area. These values will populate the TileID field in the annotation feature class attribute table.

Field
coordinate_sys_field
(Optional)

A field in the polygon index layer that contains the coordinate system information for each tile. Due to the length required for a field to store coordinate system information, a polygon index layer that contains a coordinate system field must be a geodatabase feature class.

Field
map_rotation_field
(Optional)

A field in the polygon index layer that contains an angle by which the data frame is to be rotated.

Field
feature_linked
(Optional)
LicenseLicense:

This parameter is only available with ArcEditor and ArcInfo licenses.

Choose whether the output annotation feature class will be linked to the features in another feature class.

  • STANDARD The output annotation feature class will not be linked to the features in another feature class. This is the default.
  • FEATURE_LINKEDThe output annotation feature class will be linked to the features in another feature class.
Boolean
generate_unplaced_annotation
(Optional)

Choose whether to create unplaced annotation from unplaced labels.

  • NOT_GENERATE_UNPLACED_ANNOTATIONAnnotation will only be created for features that are currently labeled. This is the default.
  • GENERATE_UNPLACED_ANNOTATIONUnplaced annotation are stored in the annotation feature class. The status field for these annotation is set to Unplaced.
Boolean

Code Sample

TiledLabelsToAnnotation Example (Python Window)

import arcpy
from arcpy import env
env.workspace = "C:/data/data.gdb"
arcpy.TiledLabelsToAnnotation_cartography("Annotation.mxd", "Layers", 
"Tiles", "data.gdb", "GroupAnno", "Anno", "", "Tile_Scale",  
"OID", "", "", "FEATURE_LINKED", "GENERATE_UNPLACED_ANNOTATION")
TiledLabelsToAnnotation Example2 (workflow script)

The following script demonstrates a workflow using the MapServerCacheTilingSchemeToPolygons and the TiledLabelsToAnnotation functions.

# Name: TiledLabelsToAnnotation_Example2.py
# Description: Create a tile feature class and use those tiles to create annotation.
# Requirements: ArcInfo license
# Author: ESRI

# Import system modules
import arcpy
from arcpy import env

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

# Set local variables
inMapDocument = "C:/data/Annotation.mxd"
inDataFrame = "Layers"
inTilingScheme = "C:/Program Files/ArcGIS/Desktop10.0/TilingSchemes/ArcGIS_Online_Bing_Maps_Google_Maps.xml"
outFeatureClass = "C:/data/data.gdb/Tiles"
inTileExtent = "USE_MAP_EXTENT"
inClipping = "CLIP_TO_HORIZON"
inAntialiasing = "NONE"
inScales = ""

# Execute MapServerCacheTilingSchemeToPolygons
arcpy.MapServerCacheTilingSchemeToPolygons_cartography(inMapDocument, inDataFrame, inTilingScheme, outFeatureClass, 
																																																							inTileExtent, inClipping, inAntialiasing, inScales)

# Set local variables
inMapDocument = "C:/data/Annotation.mxd"
inDataFrame = "Layers"
inPolygonIndexLayer = "Tiles"
inOutGeodatabase = "C:/data/data.gdb"
outOutLayer = "GroupAnno"
inAnnoSuffix = "Anno"
inRefScaleValue = ""
inRefScaleField = "Tile_Scale"
inTileIDField = "OID"
inCoordSysField = ""
inMapRotationField = ""
inFeatureLinked = "STANDARD"
inGenerateUnplaced = "GENERATE_UNPLACED_ANNOTATION"

# Execute TiledLabelsToAnnotation
arcpy.TiledLabelsToAnnotation_cartography(inMapDocument, inDataFrame, inPolygonIndexLayer, inOutGeodatabase, 
																																										outOutLayer, inAnnoSuffix, inRefScaleValue, inRefScaleField, 
																																										inTileIDField, inCoordSysField, inMapRotationField,inFeatureLinked, 
																																										inGenerateUnplaced)  

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

11/11/2011