<?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 Re: Arcade labeling for azimuth as bearings in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-labeling-for-azimuth-as-bearings/m-p/1224316#M61384</link>
    <description>&lt;P&gt;A couple suggestions:&lt;/P&gt;&lt;P&gt;Put your angle formats in their own variables. Then they can be referenced in your string without any quotes getting in the way.&lt;/P&gt;&lt;P&gt;Try using &lt;STRONG&gt;Decode&lt;/STRONG&gt; when you're just checking the value of a variable / field. &lt;STRONG&gt;When&lt;/STRONG&gt; works, but better suited for more complex conditional statements.&lt;/P&gt;&lt;P&gt;Use template literals to make an easier-to-read expression.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var unit = $feature.DistUnit;

/* This converts labels to the abbreviated unit of measurement */
var unitMeasurement = Decode(
    unit,
    'Feet','ft',
    'Kilometers','km',
    'Meters','m',
    'Miles', 'mi',
    'Nautical Miles','NM',
    'Yards', 'yd',
    ' '
);

var in_angle = {directionType:'North', angleType: 'Degrees'}
var out_angle = {directionType:'Quadrant', angleType: 'DMS', outputType: 'text', format:'p D[°] m[`] ss.ss["] b'}

var bearing_str = Text(ConvertDirection(
    Round($feature.Angle, 5),
    in_angle,
    out_angle
)

var dist = Text($feature.Distance, '#,###.##')

return `${dist} ${unitMeasurement} Bearing: ${bearing_str}`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Oct 2022 17:01:14 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2022-10-21T17:01:14Z</dc:date>
    <item>
      <title>Arcade labeling for azimuth as bearings</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-labeling-for-azimuth-as-bearings/m-p/1224306#M61381</link>
      <description>&lt;P&gt;The Insert-distance and Direction measurements tool does label the line direction as a 360 degree azimuth with a degree symbol.&amp;nbsp; I need the bearing text format like&amp;nbsp;'p D[°] m['] ss.ss["] b' like N 59° 59' 59.99".&amp;nbsp; The single quote after the minutes value is throwing off the expression since it has meaning to the evaluator.&amp;nbsp; The escape characters [] do not work with a single quote.&amp;nbsp; I did see the&amp;nbsp;TextFormatting.SingleQuote constant but have struggled to insert that into the format string.&amp;nbsp; I switched the back tick mark for the apostrophe for now.&lt;/P&gt;&lt;P&gt;Below is the labeling expression:&lt;/P&gt;&lt;P&gt;var unit = $feature.DistUnit;&lt;/P&gt;&lt;P&gt;/* This converts labels to the abbreviated unit of measurement */&lt;BR /&gt;var unitMeasurement = When(&lt;BR /&gt;unit == 'Feet','ft',&lt;BR /&gt;unit == 'Kilometers','km',&lt;BR /&gt;unit == 'Meters','m',&lt;BR /&gt;unit == 'Miles', 'mi',&lt;BR /&gt;unit == 'Nautical Miles','NM',&lt;BR /&gt;unit == 'Yards', 'yd',&lt;BR /&gt;' ');&lt;/P&gt;&lt;P&gt;Text($feature.Distance, '#,###.##') + " " + unitMeasurement + " " + "Bearing: "&lt;BR /&gt;+ Text(ConvertDirection( round($feature.Angle,5), {directionType:'North', angleType: 'Degrees'}, {directionType:'Quadrant', angleType: 'DMS', outputType: 'text', format:'p D[°] m[`] ss.ss["] b'}));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 16:46:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-labeling-for-azimuth-as-bearings/m-p/1224306#M61381</guid>
      <dc:creator>RobertGraham1</dc:creator>
      <dc:date>2022-10-21T16:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade labeling for azimuth as bearings</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-labeling-for-azimuth-as-bearings/m-p/1224316#M61384</link>
      <description>&lt;P&gt;A couple suggestions:&lt;/P&gt;&lt;P&gt;Put your angle formats in their own variables. Then they can be referenced in your string without any quotes getting in the way.&lt;/P&gt;&lt;P&gt;Try using &lt;STRONG&gt;Decode&lt;/STRONG&gt; when you're just checking the value of a variable / field. &lt;STRONG&gt;When&lt;/STRONG&gt; works, but better suited for more complex conditional statements.&lt;/P&gt;&lt;P&gt;Use template literals to make an easier-to-read expression.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var unit = $feature.DistUnit;

/* This converts labels to the abbreviated unit of measurement */
var unitMeasurement = Decode(
    unit,
    'Feet','ft',
    'Kilometers','km',
    'Meters','m',
    'Miles', 'mi',
    'Nautical Miles','NM',
    'Yards', 'yd',
    ' '
);

var in_angle = {directionType:'North', angleType: 'Degrees'}
var out_angle = {directionType:'Quadrant', angleType: 'DMS', outputType: 'text', format:'p D[°] m[`] ss.ss["] b'}

var bearing_str = Text(ConvertDirection(
    Round($feature.Angle, 5),
    in_angle,
    out_angle
)

var dist = Text($feature.Distance, '#,###.##')

return `${dist} ${unitMeasurement} Bearing: ${bearing_str}`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 17:01:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-labeling-for-azimuth-as-bearings/m-p/1224316#M61384</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-10-21T17:01:14Z</dc:date>
    </item>
  </channel>
</rss>

