Stacking Label Classes in a Single Polygon

274
7
03-05-2024 02:27 PM
EricCC
by
New Contributor II

Hello - I am working to replace a predecessors work. He relied heavily on annotation feature classes, and I'd like to move to labeling on the fly. He has literally hundreds of annotation feature classes that he manually edits to match data in the tax lots. It's, well, interesting. I'd like to replicate his work with label classes that label on the fly and of course automatically adopt the data from the attribute table. Attached is a photo of 2 annotation feature classes that he has used on one tax lot. Is there an expression that can accomplish this? If I use vbNewLine for the Lot Number and the Acres, it puts the acres into the Lot Number shield and makes a giant oval, not what I want. Can't seem to find a successful approach online. My labels are NOT stacked in fitting strategy, using Maplex Label Engine, ArcGIS Pro 3.2.2.

Photo 1 is from annotation feature classes and what I am trying to replicate.

071821ce-d2f1-4255-acc1-613b223e11f9.jpg

 Photo 2 is as close as I've been able to come. I need to be able to stack my label classes.

Labels_02.jpg

Thanks in advance!

Tags (3)
0 Kudos
7 Replies
MErikReedAugusta
Occasional Contributor III

I'd have to dig into the guts of Label functions, but a top-of-my-head guess would be to leverage <PART> from the dynamic text.

I can't remember off-hand if you can do the enclosures inside <PART>, but I think you can?

0 Kudos
EricCC
by
New Contributor II

Thanks, unfortunately I am unfamiliar with <PART>. I'm Googling, but can you give me some context?

My first label class for the lot # has a callout marker symbol and is simply: [MAP]

My second is for the acres and is simply: [AREA]

I need to be able to either stack the label classes or somehow differentiate them within the same label class. I'm going to try ChatGPT for a solution. If all that fails, I just abandon the marker callout and have text lines which are easy to stack.

Thanks!

0 Kudos
EricCC
by
New Contributor II

In addition, for some reason, this code is NOT changing my LOT text to blue. Stumped.

Function FindLabel ( [LOT] )
FindLabel = "<font color='#1E90FF'>" & [LOT] & "</font>" & vbNewLine & [AREA]
End Function

0 Kudos
SamuelTroth2
Esri Contributor

I would use this syntax to change font color to blue using vbscript

Function FindLabel ( [LOT] )
FindLabel = "<CLR blue = '255'>" & [LOT] & "</CLR>" & vbNewLine & [AREA]
End Function

0 Kudos
SamuelTroth2
Esri Contributor

Hi, I'm sorry ArcGIS Pro labelling isn't working as expected. Are you using two different label classes?

0 Kudos
EricCC
by
New Contributor II

Yeah, I have a few different label classes on the same feature layer.

0 Kudos
JesseWickizer
Esri Contributor

Here are 2 method you can try:

1. Separate label classes

You can use 2 separate label classes - one for the lot number with the point callout and another for the Acres without a callout. Don't check on Never remove (place overlapping) so your labels don't overlap like in your example. As long as there's room, both labels will place inside the polygon near one-another, though not necessarily stacked directly on top of one-another. The arrangement of the labels inside the polygons will depend on the shape of each polygon along with any other label placement properties you have configured.

JesseWickizer_0-1711999952205.png

 

2. Single label class with Composite callout

If the Lot number and Area labels must be combined in one label, you could use a Composite callout using the PART text formatting tags. Here's an example of how that would look, including your interest in changing the color of the Lot number to blue:

Label expression:

Function FindLabel ( [LOT], [AREA] )
  Dim label
  Dim lotLabel
  Dim color
  color = "red='0' green='0' blue='0'"
  If [LOT] > 103 Then
    color = "red='0' green='0' blue='255'"
  End If
  lotLabel = "<CLR " & color & ">" & [LOT] & "</CLR>"
  label = "<PART position='middle'>" & lotLabel & "</PART>"
  label = label & "<PART position='bottom'>" & [AREA] & "</PART>"

  FindLabel = label
End Function

Composite callout properties:

JesseWickizer_2-1712000361769.png

 

Result:

JesseWickizer_1-1712000093508.png

 

0 Kudos