<?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 Accessing annotation feature baseline geometry in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-annotation-feature-baseline-geometry/m-p/1556822#M86046</link>
    <description>&lt;P&gt;Hello there&lt;/P&gt;&lt;P&gt;I need to access the (text) baseline geometry of an annotation feature. I'm aware that with annotations, the feature geometry contains the (readonly and auto-updated) bounding box of the text element, so I have to get the symbol using the element field.&lt;/P&gt;&lt;P&gt;Using the normal query mechanism I'm able to get its value and decoding it from binary (using atob()) I can see the coordinates of the start and the end point of the line, but not its spatial reference. This leaves me in trouble as the stored coordinates are in a different coordinate system than the map's one. Unfortunately I haven't been able to find any SDK functionality that offers me to access this binary string as I didn't find any support for &lt;A title="CIMTextGraphic" href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic5721.html" target="_blank" rel="noopener"&gt;CIMTextGraphic&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;So my question would be: How can I convert/deserialize this binary string into a fully processable format with JavaScript?&lt;/P&gt;&lt;P&gt;This is an example what my code looks like so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const extent: Extent = getCurrentExtent();
const features = await query.executeQueryJSON(myAnnotationLayerUrl, {
    spatialRelationship: "intersects",
    outSpatialReference: extent.spatialReference,
    outFields: ["*"],
    returnGeometry: true,
    geometry: extent,
}).then(features =&amp;gt; {
    for (const feature of features.features) {
        const element = getFieldAs&amp;lt;string&amp;gt;(feature.attributes, "element");
        const baseline = atob(element);
        // returns something like: 
        // &amp;#1;1 &amp;#2;*K390314.56620000023,5820539.9339000005;390333.81819999963,5820487.34149999922&amp;#15;Musterstraße8�A&amp;#4;V&amp;#14;-!r@
        
    }
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Nov 2024 15:40:01 GMT</pubDate>
    <dc:creator>MichaelWidmer</dc:creator>
    <dc:date>2024-11-08T15:40:01Z</dc:date>
    <item>
      <title>Accessing annotation feature baseline geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-annotation-feature-baseline-geometry/m-p/1556822#M86046</link>
      <description>&lt;P&gt;Hello there&lt;/P&gt;&lt;P&gt;I need to access the (text) baseline geometry of an annotation feature. I'm aware that with annotations, the feature geometry contains the (readonly and auto-updated) bounding box of the text element, so I have to get the symbol using the element field.&lt;/P&gt;&lt;P&gt;Using the normal query mechanism I'm able to get its value and decoding it from binary (using atob()) I can see the coordinates of the start and the end point of the line, but not its spatial reference. This leaves me in trouble as the stored coordinates are in a different coordinate system than the map's one. Unfortunately I haven't been able to find any SDK functionality that offers me to access this binary string as I didn't find any support for &lt;A title="CIMTextGraphic" href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic5721.html" target="_blank" rel="noopener"&gt;CIMTextGraphic&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;So my question would be: How can I convert/deserialize this binary string into a fully processable format with JavaScript?&lt;/P&gt;&lt;P&gt;This is an example what my code looks like so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const extent: Extent = getCurrentExtent();
const features = await query.executeQueryJSON(myAnnotationLayerUrl, {
    spatialRelationship: "intersects",
    outSpatialReference: extent.spatialReference,
    outFields: ["*"],
    returnGeometry: true,
    geometry: extent,
}).then(features =&amp;gt; {
    for (const feature of features.features) {
        const element = getFieldAs&amp;lt;string&amp;gt;(feature.attributes, "element");
        const baseline = atob(element);
        // returns something like: 
        // &amp;#1;1 &amp;#2;*K390314.56620000023,5820539.9339000005;390333.81819999963,5820487.34149999922&amp;#15;Musterstraße8�A&amp;#4;V&amp;#14;-!r@
        
    }
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 15:40:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-annotation-feature-baseline-geometry/m-p/1556822#M86046</guid>
      <dc:creator>MichaelWidmer</dc:creator>
      <dc:date>2024-11-08T15:40:01Z</dc:date>
    </item>
  </channel>
</rss>

