I have a data set with 5 polygons. I would like to label each polygon with different values from different attribute columns. See screen shot. The first box on the left should pull its label from the column IP in the attribute table. The second box from the left should pull its label from the Easting column and so on. I just can not remember how to do this. Its been years since I did it last. This is one feature class and not 5 different feature classes.
-
1Does your dataset only ever have 5 rows equating to the 5 polygons? Or are you showing us a subset of the true dataset?Hornbydd– Hornbydd2021年06月24日 16:47:24 +00:00Commented Jun 24, 2021 at 16:47
3 Answers 3
You can set up label classes to label each feature (or set of features) with different label information. Each label class will include a set of features to be labeled, what column the label will be pulled from, and formatting for the label.
I think a simplest approach is populating new field using field calculator, e.g:
def label(aList):
fid = aList.pop(0)
return aList[fid]
#----
label([ !FID!, !IP!, !EASTING!, !NORTHING!, !LENGTH!, !ANGLE!, !LABEL!])
Can be done with advanced labelling, but bulky, because every variable in it treated as text.
Open attribute table of feature,
add fields
select column than right click, open field calculator
in this window, select type of function, for example, select String type, than in functions, double click to str, than in below window, in parenthesis, double click to FID field, it was generate a expression like this: Sqr ( [FID] )
Click OK button
This generate FID labels to FIELD2
You can use other string type functions for generate labels using part of label, too.
Explore related questions
See similar questions with these tags.