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
Label class scale ranges are respected. When the tool generates annotation for a specific reference scale it will only convert label classes that are turned on and visible at that scale.
If you select tiles prior to running the tool, annotation will only be created for the selected tiles.
To update annotation for only some tiles in the polygon index layer, first select the annotation features with that specific TileID value and delete them. Then select the polygon features and re-run the tool.
One output of this tool is a series of group layers. One group layer will contain a group layer for each reference scale for which annotation was created.
When working in ArcCatalog or ModelBuilder, 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 layers created in ArcCatalog cannot be used in ArcMap unless they are saved to a layer file using the Save_To_Layer_File tool.
An existing group layer will be overwritten if the same layer name is specified and if you explicitly state that overwriting outputs is allowed.
If duplicate feature class names are found in the data frame, a number will be added to the annotation following the feature class name (e.g., Cities01Anno10000, Cities02Anno10000, and so on).
Annotation feature classes will not be overwritten if a suffix is specified that already exists. In this case a number will be added to the annotation feature class suffix (e.g., CitiesAnno10000, CitiesAnno10000_1, and so on).
The reference scale for the annotation feature classes can be specified in one of two ways.
- The first option is to use a field from the polygon index layer to determine the reference scale of the output annotation feature classes. Use this option if you will create annotation for a variety of scale levels.
- The second option is to explicitly state a reference scale value. All annotation feature classes will use this reference scale. If a reference scale is set in the map document, this will be the default value input into the tool. When using ArcMap, if no reference scale is set the current scale will provide the default value.
If you are using a polygon index layer that was created by the the Map_Server_Cache_Tiling Scheme To Polygons tool use the Tile_Scale field for the Reference Scale Field. A new anotation feature class will be created for each layer/Tile_Scale combination.
If you are producing annotation at a variety of reference scales, design your map for each of those scales and avoid setting a reference scale in the data frame.
If a coordinate system field from the polygon index layer is provided the annotation for each tile will be projected into that coordinate system for the purpose of drawing and placement.
Annotation that is feature linked is associated with a specific feature in another feature class in the geodatabase. If checked, when you create the output annotation feature class, a relationship class will be automatically generated as well.
When creating feature-linked annotation the output workspace must be the same as that of the feature classes they are linked to.
Some labels may not currently display on the map because there is no room for them. To convert these labels, check the Generate Unplaced Annotation box. This saves the unplaced labels in the annotation feature class, allowing you to position them later in an ArcMap edit session.
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})
Parameter | Explanation | Data 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) | Choose whether the 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.
| 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: ArcGIS for Desktop Advanced license
# 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.2/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
Licensing information
- ArcGIS Desktop Basic: Yes
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes