<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Java arcobjects - converting labels to file GDB annotation problems in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/java-arcobjects-converting-labels-to-file-gdb/m-p/554952#M15026</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello - I am using ArcGIS 10 and am using Java Arcobjects to perform some of my operations.&amp;nbsp; What I am trying to do is convert labels to geodatabase annotations within a file geodatabase.&amp;nbsp; We start out with feature classes in the file geodatabase in which we create layers that are added to our MXD document.&amp;nbsp; I need to create geodatabase annotations for the map layer feature labels.&amp;nbsp; I found an article at &lt;A href="http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualhelp/engine/index.html#/How_to_convert_labels_to_geodatabase_annotation_for_a_single_layer/0001000002pm000000/" title="http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualhelp/engine/index.html#/How_to_convert_labels_to_geodatabase_annotation_for_a_single_layer/0001000002pm000000/"&gt;ArcObjects 10 Java SDK Help&lt;/A&gt;‌ which seems to describe how I can do this.&amp;nbsp; My code below is modeled from that article:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------&lt;/P&gt;&lt;P&gt;IConvertLabelsToAnnotation convertLabToAnno = new ConvertLabelsToAnnotation();&lt;BR /&gt;ITrackCancel trackCancel = new CancelTracker();&lt;BR /&gt;convertLabToAnno.initialize(map,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esriAnnotationStorageType.esriDatabaseAnnotation,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esriLabelWhichFeatures.esriAllFeatures, true, trackCancel, null);&lt;/P&gt;&lt;P&gt;ILayer layer = map.getLayer(layerIndex);&lt;BR /&gt;IGeoFeatureLayer geoFeatureLayer = (IGeoFeatureLayer)layer;&lt;BR /&gt;if (geoFeatureLayer != null){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeatureClass featureClass = geoFeatureLayer.getFeatureClass();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IDataset dataset = new IDatasetProxy(featureClass);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeatureWorkspace featureWorkspace = new IFeatureWorkspaceProxy&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (dataset.getWorkspace());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; convertLabToAnno.addFeatureLayer(geoFeatureLayer, geoFeatureLayer.getName() &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + &lt;STRONG&gt;"_Annos",&lt;/STRONG&gt; featureWorkspace, featureClass.getFeatureDataset(),&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLinked, false, false, true, true, "");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Do the conversion.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; convertLabToAnno.convertLabels();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;-------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The end result is that my file geodatabase does contain a new feature class with the extension "_Annos" for each of the origianl feature classes.&amp;nbsp; The problem is that the feature class does not have any data in it.&amp;nbsp; It is just an empty feature class which appears to contain the correct columns.&amp;nbsp; When I check each of my map's layer's properties, I see that the Label tab indicates the proper column (NAME) for the label name.&amp;nbsp; I am not sure what I am missing that is keeping the annotations from populating the annotation feature class.&amp;nbsp; I know that my feature classes have labels ( I can turn them on and off) so am not sure what I am not doing.&amp;nbsp; Does anyone have any clues??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks - Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Aug 2014 18:59:12 GMT</pubDate>
    <dc:creator>PeterLen</dc:creator>
    <dc:date>2014-08-19T18:59:12Z</dc:date>
    <item>
      <title>Java arcobjects - converting labels to file GDB annotation problems</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/java-arcobjects-converting-labels-to-file-gdb/m-p/554952#M15026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello - I am using ArcGIS 10 and am using Java Arcobjects to perform some of my operations.&amp;nbsp; What I am trying to do is convert labels to geodatabase annotations within a file geodatabase.&amp;nbsp; We start out with feature classes in the file geodatabase in which we create layers that are added to our MXD document.&amp;nbsp; I need to create geodatabase annotations for the map layer feature labels.&amp;nbsp; I found an article at &lt;A href="http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualhelp/engine/index.html#/How_to_convert_labels_to_geodatabase_annotation_for_a_single_layer/0001000002pm000000/" title="http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualhelp/engine/index.html#/How_to_convert_labels_to_geodatabase_annotation_for_a_single_layer/0001000002pm000000/"&gt;ArcObjects 10 Java SDK Help&lt;/A&gt;‌ which seems to describe how I can do this.&amp;nbsp; My code below is modeled from that article:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------&lt;/P&gt;&lt;P&gt;IConvertLabelsToAnnotation convertLabToAnno = new ConvertLabelsToAnnotation();&lt;BR /&gt;ITrackCancel trackCancel = new CancelTracker();&lt;BR /&gt;convertLabToAnno.initialize(map,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esriAnnotationStorageType.esriDatabaseAnnotation,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esriLabelWhichFeatures.esriAllFeatures, true, trackCancel, null);&lt;/P&gt;&lt;P&gt;ILayer layer = map.getLayer(layerIndex);&lt;BR /&gt;IGeoFeatureLayer geoFeatureLayer = (IGeoFeatureLayer)layer;&lt;BR /&gt;if (geoFeatureLayer != null){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeatureClass featureClass = geoFeatureLayer.getFeatureClass();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IDataset dataset = new IDatasetProxy(featureClass);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeatureWorkspace featureWorkspace = new IFeatureWorkspaceProxy&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (dataset.getWorkspace());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; convertLabToAnno.addFeatureLayer(geoFeatureLayer, geoFeatureLayer.getName() &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + &lt;STRONG&gt;"_Annos",&lt;/STRONG&gt; featureWorkspace, featureClass.getFeatureDataset(),&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLinked, false, false, true, true, "");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Do the conversion.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; convertLabToAnno.convertLabels();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;-------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The end result is that my file geodatabase does contain a new feature class with the extension "_Annos" for each of the origianl feature classes.&amp;nbsp; The problem is that the feature class does not have any data in it.&amp;nbsp; It is just an empty feature class which appears to contain the correct columns.&amp;nbsp; When I check each of my map's layer's properties, I see that the Label tab indicates the proper column (NAME) for the label name.&amp;nbsp; I am not sure what I am missing that is keeping the annotations from populating the annotation feature class.&amp;nbsp; I know that my feature classes have labels ( I can turn them on and off) so am not sure what I am not doing.&amp;nbsp; Does anyone have any clues??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks - Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 18:59:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/java-arcobjects-converting-labels-to-file-gdb/m-p/554952#M15026</guid>
      <dc:creator>PeterLen</dc:creator>
      <dc:date>2014-08-19T18:59:12Z</dc:date>
    </item>
  </channel>
</rss>

