Copy Label Classes to multiple layers

1476
5
01-28-2021 08:19 AM
Labels (1)
CherylWheeler11
New Contributor III

Hi,

Would anybody be able to tell me if it is possible in Pro to copy a set of label classes from one layer to others. I have set up multiple label classes, which I would like to replicate in other layers in my map. I can see that I can copy and paste each individual class into a new class in each of the other layers, but is there a way that I can do them all at once. (I have 11 label classes and 18 layers to apply them to!)

CherylWheeler11_0-1611850381569.png

I have multiple layers in the same map which I would like to label in the same way. (For some reason the Create Labels from Symbology tab is greyed out???)

 

Many thanks for any insights.

 

 

0 Kudos
5 Replies
jcarlson
MVP Notable Contributor

If you hover over the greyed out option, it does tell you that your symbology needs to be set to Unique Values, Graduated Colors, or Graduated Symbols so that it has distinct classes to apply to, and also that your symbology needs to be based on a field, not an expression. This is because the label class definition needs to convert cleanly to SQL, which won't work off an expression.

My first suggestion would be to check out your symbology, and if possible, adjust it to directly reference fields rather than an expression. The Create Labels from Symbology tool will still work if your symbology is based on multiple fields.

If that doesn't work, you're in for a lot of clicking, or possibly some Python. While you can copy a single label class's properties, you can't copy the class itself, so you need an existing label class to paste the properties into. Such a workflow would look like:

  1. Right-click label class in source layer and click "copy"
  2. Create a new label class in destination layer
  3. Right-click the new label class and click "paste", select "all properties"
  4. Groan inwardly and repeat for every single label class

jCarlson_0-1611853407304.png

It's not a great method, but if you really can't set label classes from symbology, it could work.

It's also worth noting that the GP tool Apply Symbology from Layer does pick up label classes, not just symbols. But of course, it will change the symbology, which maybe you don't want to do. You could save your symbology to styles, run the tool to import the label classes, then re-set the symbols to the styles afterward. But again, tedious and indirect. I'd check out your symbology settings first.

- Josh Carlson
Kendall County GIS
CherylWheeler11
New Contributor III

Mmm, thanks very much Josh. I actually can't use multiple attributes for the symbology because I found that when I published the layers to Portal, that functionality wasn't allowed. Therefore, I used Arcade expressions which did work for that purpose, but now I have this new headache!. Never mind.....I'll get clicking :beaming_face_with_smiling_eyes:

Thanks again. I will go the create new label class, copy, paste route! I appreciate your response.

0 Kudos
jcarlson
MVP Notable Contributor

You can still use the multiple-fields option, albeit just in Pro. Even if it comes from a hosted layer, you won't be constrained by those same limitations within the Pro software. Were you needing the label classes to translate to something that works in Portal?

If you use the Map Viewer Beta, that does give you the option of creating separate label classes with different SQL filters, so that's an option for multi-field-based label classes that are web-friendly. No such luck in the standard Map Viewer, though.

- Josh Carlson
Kendall County GIS
CherylWheeler11
New Contributor III

Hi, Yes, we deliver our webapps through Portal. Unfortunately we do not appear to have MapViewerBeta installed on Portal, although it is on AGOL.  Maybe I can do it through a distributed collaboration if I use AGOL to create a webmap to feed my webapp in Portal. I will investigate.

Thanks again Josh.

0 Kudos
MichaelBillings
New Contributor

If you are still looking for an answer on this, XTools Pro for ArcPro will allow you to copy Label Properties to other layers in the TOC. It will copy multiple layer properties.  Also, make sure that your layer schemas are the same.

MichaelBillings_0-1644596263530.png

Hope this helps.

Michael

0 Kudos