Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

how could I do the following steps with arcpy:

  1. right-click on the layer with the features
  2. Label Features
  3. Convert Labels to Annotations ...

The annotions should be saved in a new shapefile.

How could I do this in python?

share|improve this question
The shapefile format does not support annotation. Are you looking to save them in a file geodatabase as annotations or in a point shapefile with text, angle, level, height, and symbol attributes? – PolyGeo Jul 24 '11 at 23:06

You can use the Tiled Labels To Annotation Geoprocessing tool.

import arcpy

# Settings
scale = "30000"  
folder = "D:\Temp\LBL.gdb"  
arcpy.env.workspace = folder  

# Mapdocument
map = r"D:\Temp\MAP-LBL.mxd"  

# Local variables:
dataFrame = "Layer"  
grid = "Grid"  
group = "Group"  
suffix = "Anno"  
fid = "tile"  
link = "STANDARD"  # not linked = "STANDARD" / linked = "FEATURE_LINKED"   

# Process: Tiled Labels To Annotation
arcpy.TiledLabelsToAnnotation_cartography(map, dataFrame, grid, folder, group, suffix, scale, "", fid, "", "", link, unplace)
share|improve this answer

Below is a similar question to yours that was answered on this site.

Can you create labels based on an attribute field in a shapefile with Arcpy?

share|improve this answer
There is nothing in this post about Annotation, only labeling features. – klewis Jun 26 '14 at 21:36

You can enable labels through use of the LabelClass class in arcpy's mapping module, but I am not aware of a method for creating annotations in python. Hopefully this will be added as ESRI continues to improve arcpy functionality and integration.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.