Select to view content in your preferred language

Resources for ArcGIS Pro Labeling and Annotation Technical Workshops at UC 2024

1100
0
06-05-2024 02:34 PM

Resources for ArcGIS Pro Labeling and Annotation Technical Workshops at UC 2024

We are offering two technical workshops at the 2024 User Conference about labeling and annotation in ArcGIS Pro. 
This technical workshop will be offered twice:
Wednesday, July 17, 2024: 2:30 - 3:30pm, room 17 AB
Thursday, July 18th, 2024: 10:00 - 11:00am, room  17 AB
 
This technical workshop will be offered twice:
Wednesday, July 17, 2024: 4:00 - 5:00pm, room 33 ABC
Thursday, July 18th, 2024: 4:00 - 5:00pm, room  17 AB
 
 

Below you will find some materials presented at our ArcGIS Pro Labeling and Annotation technical workshops presented at the 2024 User Conference .

Arcade Expressions for Rounding Numbers

This expression from the Labels and Annotation workshop divides the POP_MAX field by 1,000,000 then uses the Round function to reduce the number to 2 decimal places.

 

$feature.NAME + " (" + Round($feature.POP_MAX/1000000, 2) + "M)"

 

 
Our point rotation demo from the Getting the Most from the Maplex Label Engine workshop used the Text function to round the percent change attribute to only 1 decimal place and append the units (%) to the end of the label.

 

Text($feature.PctChange2022_2023, "#.#") + "%"

 

Institute points alternate label expression:

This expression was used as an alternate expression of our abbreviation settings in our Institutes point layer.

  1. It creates arrays of uppercase words commonly found in education place names and a separate array of words found in religious institution names.
  2. Then it loops through all the terms in each array, and if the term is found in the Name2 field value, it returns "Edu." or "Rel." to use as the entire label, depending on which array it is searching. Since the Find() Arcade function is case-sensitive, it converts the Name2 field value to uppercase for the comparison.
  3. Finally, if it is not found, it returns the feature's Name2 field value, converted to Proper case.

 

var eduSearchTerms = ["SCHOOL", "ACADEMY", "COLLEGIATE", "COLLEGE", "UNIVERSITY"]
var relSearchTerms = ["CHURCH", "MOSQUE", "SYNAGOGUE", "MONASTRY", "TEMPLE", "TABERNACLE", "WORSHIP"]

for (var i in eduSearchTerms)
{
  if(find(eduSearchTerms[i], upper($feature.Name2)) > -1)
    return "Edu."
}

for (var i in relSearchTerms)
{
  if(find(relSearchTerms[i], upper($feature.Name2)) > -1)
    return "Rel."
}

return proper($feature.Name2)

 

 

Abbreviation dictionary for official United States Postal Service abbreviations:

See Esri technical support article.

 

Parcels demo alternate label abbreviation expression:

 

//Split up label into parts for the square and the lot.
var parts = Split($feature.Parcel_Label, "-");
if (Count(parts) == 0) {
  return "";
}
if (Count(parts) == 1) {
  return parts[0];
}

//Reduce the font size of the "Square" part of the label while keeping the "Lot" part of the label at full size
var label = "" + parts[0] + "";
label += parts[1];
return label;

 

Advanced Label Expressions

These expressions use Upper()Right() and Count() Arcade functions to extract the characters after "Co Rd " or "State Hwy " in the FULLNAME field:

County Roads:

 

Upper(Right($feature.FULLNAME, Count($feature.FULLNAME) - 6))

 

 

State Highways:

 

Right($feature.FULLNAME, Count($feature.FULLNAME) - 10)

 

 

US Highways:

This expression takes into account any US Highways with banners in their names and places the banner above the number with a smaller font size.

Examples include "US Hwy 45 Alt" and US Hwy 151 Bus"

JesseWickizer_2-1689046922604.png  JesseWickizer_3-1689046945045.png JesseWickizer_4-1689046957115.png

  1. Extract all the text after "US Hwy " and assign it to the shieldValue variable.
  2. Check if there's a space in the remaining text which means it has a banner - if so, split by the space and assign the text on either side of the space to either the shieldBanner or shieldNumber.
  3. The shields with a shieldBanner use text formatting tags to reduce the leading between banner and text, and make the banner text a smaller font size (8pt).
  4. If there's no banner, don't do any special formatting - just return the number to be placed in the shield.

 

var shieldValue = Right($feature.FULLNAME, Count($feature.FULLNAME) - 7);
var shieldBanner = "";
var shieldNumber = shieldValue;
if(Find(" ", shieldNumber) > 0) {
  shieldBanner = Split(shieldNumber, " ")[1];
  shieldNumber = Split(shieldNumber, " ")[0];
  return "<LIN leading='-4' leading_type = 'extra'>" + "<FNT size='8'>" + Upper(shieldBanner) + 
         "</FNT>" + TextFormatting.NewLine + shieldNumber + "</LIN>";
} else {
  return shieldNumber; 
}

 

 

Text Formatting Tags

Superscript 2 in the Km squared label:

JesseWickizer_0-1689046873834.png

 

$feature.ALAND_KM2 + " km<SUP>2</SUP>"

 

 

State labels with average commute times and change in average commute time since 2010:

JesseWickizer_1-1689046882862.png

 

var arrowStyle = "▲"; //Default all arrows to show an increase
if($feature.CommuteChange2010_2021 < 0) {
  //Change to decrease arrow if the change in commute time decreased from 2010 to 2021.
  arrowStyle = "▼";
}
//Configure values for the CLR (color) tag based on the size of increase or decrease in commute time.
var arrowColor = "red='253' green='174' blue='97'"; // small increase
if($feature.CommuteChange2010_2021 > 1) {
  arrowColor = "red='215' green='25' blue='28'"; // large increase
}
if($feature.CommuteChange2010_2021 < 0) {
  arrowColor = "red='171' green='217' blue='233'"; // small decrease
}
if($feature.CommuteChange2010_2021 < -1) {
  arrowColor = "red='44' green='123' blue='182'"; // large decrease
}

//Use text formatting tags to:
// 1. Define the PARTs used in the Composite callout symbol grid.
// 2. Adjust font size of the state label with FNT tag.
// 3. Format numeric attributes using the Text function with a string pattern.
// 4. Set the arrow's color by inserting the parameters of the CLR tag set in the arrowColor above.
// 5. Put the commute time change value in italics with the ITA tag. 
"<PART position='middle'>" + 
"<FNT size='16'>" + $feature.STUSPS + "</FNT></PART>" +
"<PART position='right'>" + 
Text($feature.MeanCommute2021, "#.#") + " min" + TextFormatting.NewLine + 
"<CLR " + arrowColor + ">" + arrowStyle + "</CLR>" + 
"<ITA>" + Text($feature.CommuteChange2010_2021, "#.#") + " min" + "</ITA></PART>"

 

 

Additional Resources:

Help article: Add text on a map

Help article: Label with the Maplex Label Engine

Quick-start Tutorial: Label the map

Help article: Use the Labeling Summary report

Help article: Text formatting tags

Version history
Last update:
‎07-16-2024 11:29 PM
Updated by:
Contributors