Is there a way to set label offset values in the label expression?

2227
2
07-18-2016 01:32 AM
Highlighted
New Contributor III

I need to label a lot of coincident points that are meant to be symbolized and labeled with different offsets based on a row/column rule (two integer fields). I managed to display the symbols nicely using the Arcgis PRO "Connected Attributes" feature but so far I failed to use a dynamic offset for labels as well.

The workaround is to create a Label Class for each row/column value (based on a query) and then setting the offset value manually. This solution is not only time-consuming but also more demanding processing-wise, which is going to be a problem since I need to publish this as a web map service.

What I want to do is to set the offset value in the label expression itself, based on the attributes of the points. I know that you can format text in the expression but I couldn't find any reference on how or even if you can manage other label properties with a script.

Does anybody know a possible solution or a workaround?

Tags (3)
Reply
0 Kudos
2 Replies
Highlighted
MVP Esteemed Contributor

They don't show a visual and I can't get a clear picture, but have you seen this Setting point label placement properties—Help | ArcGIS for Desktop and this Shifting labels from a fixed position—Help | ArcGIS for Desktop

but the limitations appear to give a maximum of 9 label positions

In Pro       Offset point labels—ArcGIS Pro | ArcGIS for Desktop seems to have similar functionality to

in ArcMap Offsetting point labels—Help | ArcGIS for Desktop

and both with Maplex Specify a point label position—ArcGIS Pro | ArcGIS for Desktop

I can't find reference to what you used in pro, and it would be interesting to see what you used.

Reply
0 Kudos
Highlighted
New Contributor III

Thank you for your reply, but everything you referenced will work only for a specific label class with manually set values. What I want to achieve is to have labels in a SINGLE class display with different set positions based dynamically on the attributes of each feature.

As in, if I have a point with values for row/column 1,1 the label should have an offset value of 25,25pts, a point with values 2,1 should be labeled at 25, 50pts and so on.

I had the same problem with the symbols (they have to be stacked and displayed in a "matrix" even if the geometries are coincident) but then I found this : Attribute-driven symbology—ArcGIS Pro | ArcGIS for Desktop

With this feature I can link one or more symbol properties (in my case, the x,y offset) to an attribute with an expression, so my symbols will stack nicely based on the values I store in the data and I don't need to create one symbol with the set offset for each possible combination (I would end with hundreds of them!).

Unfortunately, this feature seems to be lacking in the Label Properties, so my only hope is to use somehow the label expression to replicate the same behaviour, but I don't know any Python or JS property that will allow me to manipulate the label position dynamically.

Reply
0 Kudos