Custom Arcade Expression removes duplicate labels

1101
5
01-30-2019 03:52 PM
StevenDague
New Contributor III

I have a map image service for street sweeping.  Each day of the week has two areas that are swept on alternating weeks.  I create a custom Arcade expression [DomainName($feature, 'SweepDay')] to label the Domain value, not code.  The proper day is labeled but for only one feature and all duplicates are removed.  Can I change the expression or change something else to label each feature and not remove duplicates?  The Yellow and Blue should be labeled Friday, purple shades are Wednesday, pink/red for Thursday, etc.  Only one label is present instead of two or three depending on the day of the week.Street Sweeping Labels

Steven Dague
GIS Analyst
0 Kudos
5 Replies
XanderBakker
Esri Esteemed Contributor

Hi Steven Dague , 

I have a couple of comments and questions:

  • Arcade will probably not provide you any control over which labels are being shown
  • I just tried to label a polygon feature service with multiple polygon that have the same label text and they all show up. No Arcade expression used, but I don't think that influences the result. No setting in the label configuration to influence the behavior. Do you by any chance have multi-part polygons? If so, that will probably be the reason for a single label to appear. You could use desktop to convert multi-part polygons to single part.
  • I have used Arcade to change the display of polygons and lines based on the day the area would be swept or garbage would be collected. Each day different polygons will be highlighted to indicate the areas that are being serviced. The pop-up also show the date of the next service. A description of how I did this (unfortunately in Spanish, but Google does a great job in translating and get a general idea of what is done) can be found here: Visualizar el esquema de barrido y el próximo barrido en una ventana emergente con Arcade 

Let me know if you need some help implementing this. 

0 Kudos
StevenDague
New Contributor III

Xander,

Each unique color is a unique feature.  Each feature is a multi-part feature.  I am using an Arcade expression because the attribute that I am labeling by is controlled by a domain.  If I do not use the expression, the labels are the coded value, not the text description.  I understand that Arcade does not control label placement, but it appears that it is limiting duplicates in this instance for some reason.  Not sure if it is a bug or something else.  Thank you for providing some information.  I will be looking at your link and translating it.

Steven

Steven Dague
GIS Analyst
0 Kudos
XanderBakker
Esri Esteemed Contributor

So, just to see if I understand this correctly... When you label the features without expression (so using the code and not description) all parts of the multipart polygons are labelled and when you use the Arcade expression  for the description it only labels one part of a multipart polygon?

0 Kudos
StevenDague
New Contributor III

When I label without expression, it labels the code and it eliminates duplicate labels.  The labels are removed regardless of the expression.  I just verified this.  I also went back to the data and verified that each feature has its value selected from the domain list, not a hand-typed or incorrectly input value.  I think it must be a data side issue, since the missing labels are the same regardless of whether the expression is used.  This may have been an oversight at the beginning or it could be a recent change ( I have been editing this specific layer this week).  I will test if this issue exists on other layers with coded domains or if it is unique to the street sweeping data.

Steven Dague
GIS Analyst
0 Kudos
XanderBakker
Esri Esteemed Contributor

That makes sense. It look like ArcGIS Online will only label 1 feature part. The only way to avoid this is to manage your data as single part polygons.

0 Kudos