annotation feature class to shapefile

6063
6
06-21-2012 10:23 AM
helenchu
Occasional Contributor II
Hi:

I used feature class to shapefile tool for my annotation layer and the the annotation's font, demension in shapefile are all messed up. Is there a better way to do this in python?  Thank you.
6 Replies
JoshuaChisholm
Occasional Contributor III
Hello Helen;
As far as I know, its not possible to have an annotation shapefile (they are only permitted in GeoDataBases like a '.mdb' or '.gdb').
One workaround is creating a shapefile of polygons that perfectly outline the annotations. The resulting polygons would not be scale dependent. If this is ok, you can use the tool "Feature Outline Masks" and make sure Method/Mask Kind is set to 'EXACT'.
A python script can be made to run this tool, but if you only have to run the tool a few times, I'd suggest not to bother with python.
Let me know how it goes.
Good Luck!
0 Kudos
by Anonymous User
Not applicable
Original User: helenchu

Hi Joshua

Thanks so much for your help.  Sorry it took so long for me to get back to this issue.  I had to work on some other things.
I tried what you suggested and it worked like a charm.  However it did not really solve my problem.  I have to do the layer export on monthly or even weekly basic with many layers so my goal is to write some scripts that one click will take care of all.
The intersecting Layers Masks tool doesn't let me to use it in Model, look like I have to be in Arcmap to be able to use that tool.  Please correct me if I'm wrong.  Again, thank you.
0 Kudos
ChristopherThompson
Occasional Contributor III
the annotation's font, demension in shapefile are all messed up

Can you clarify what you mean here? Are you saying that the the font name that is captured in the FontName field when you do this is different from what its set to as an annotation layer in your map? And what do you mean by dimension in this context?  I guess I am also curious why you would want to export an existing annotation to a shapefile?
0 Kudos
by Anonymous User
Not applicable
Original User: helenchu

1/ I need to provide to public those layers so I choose to ftp shapefiles to our site for public downloading.
2/Annotation:  using feature class to feature class or feature class to shapefile, when we use labels feature to turn on the street names, they are all shown horizontally like you place a text, not follow along the street lines.

I have scripts in addin that could achieve this thing by 2 steps: converting the anno feature class to "esriGeometryType.esriGeometryPolyline" first then covert shapefile.  But with vb.net scripts I ran into problem with another layer that joined with a sql table.  It did not pick up fields in joined table.  My goal is to convert all layers in 1 click either in python or  by an addin.
0 Kudos
ChristopherThompson
Occasional Contributor III
using feature class to feature class or feature class to shapefile, when we use labels feature to turn on the street names, they are all shown horizontally like you place a text, not follow along the street lines.


I just created a shapefile from an annotation, what i got back from that is a polygon shapefile where each polygon represents the extent of the annotation (the specific label).  In the attribute table there are a whole host of attributes including: TextString (contains the label information), FontName and Angle of the text.  If I convert the polygon shapefile to centroids, then I can control the angle of the text by using the value in the Angle field.  Now how you might be able to manipulate this in a script.. That depends on if arcpy.mapping has classes/functions for handling labeling - though it looks like the LabelClass class is pretty limited:http://resources.arcgis.com/en/help/main/10.1/index.html#/LabelClass/00s30000002t000000/

One approach might be to create a layer file set up how you want things to work (a .lyr file stored on disk) and then reference that using arcpy.mapping.UpdateLayer to update how your annotation shapefile should appear.
0 Kudos
by Anonymous User
Not applicable
Original User: helenchu

Thank you.  I'll try.
0 Kudos