Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pmacMaps/51db37586b9256ff45deb296bdc17172 to your computer and use it in GitHub Desktop.
Save pmacMaps/51db37586b9256ff45deb296bdc17172 to your computer and use it in GitHub Desktop.
An Esri Arcade expression for labeling features or map pop-ups that combines various road street name component fields into a single value.
// This is an Esri Arcade expression for labeling features or map pop-ups that combines various road street name component fields into a single value.
// It tests for empty values in the record. If the value is empty, it returns an empty string ('').
// If the value is not empty, it returns the value of the record.
// See https://developers.arcgis.com/arcade/ for more information on Arcade
// See https://www.nena.org/page/NG911GISDataModel for more information on NENA NextGen911 data model
// Example road: North Main Street
// variable to hold the contents of the label for roads
var road_label = "";
// variable to hold road pre-directional value ("North")
var road_prefix = IIf(IsEmpty($feature["St_PreDir"]), '', $feature["St_PreDir"]);
// variable to hold road name value ("Main")
var road_name = IIf(IsEmpty($feature["St_Name"]), '', $feature["St_Name"]);
// variable to hold road suffix value ("Street")
var road_suffix = IIf(IsEmpty($feature["St_PosTyp"]), '', $feature["St_PosTyp"]);
// variable to hold road post-directional value ("")
var road_postdir = IIf(IsEmpty($feature["St_PosDir"]), '', $feature["St_PosDir"]);
// variable to hold combined road name ("North Main Street")
road_label = Concatenate([road_prefix, road_name, road_suffix, road_postdir], ' ')
// you must return a value for Arcade to work properly
return road_label;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment