Hi Community!
I would like to create a label for a layer that has an attribute table of only one row - just object ID and coordinates. I would like to give the layer a custom label. Is there method for accomplishing this or should I just add a new field to my table with the label I want to use?
Thanks in advance!
Jill
The custom label would simply be text, either a year or the name of a group of whales.
Solved! Go to Solution.
Hi
You can do this by creating a simple Python label expression. All you need to do is:
1: Labelling tab > Label button to label the features.
2: For Field choose the Expression button.
3: In the Label Class dialog change the Language to Python
4:Write the following Expression:
"OID: " + [OID] + "\nXCOORD: " + [XCoord] +"\nYCOORD: " + [YCoord]
5: Press the Check button to check the syntax and then the Apply button.
Hopefully that is it.
Many thanks ed
If it really is one point and the label you want to display is information that does not exist in any part of any attribute then you can simply type the text as shown below.
But this approach in my opinion is you being slack and that will only come back and bite you... What happens if you want to share this data or some other might want to do some spatial processing with your data? Your label exists nowhere but in the layer in the project. I would create a new field and populate it with the text that will become the label. Then it is clear where the label is coming from and becomes useful information that you or others can take advantage of.
Great point, thank you!
With just one feature, and you want to add text to label:
R_
Thank you! Works perfectly.
And the T2Cs are one of my favorite families. I was able to see how well they took care of Tumbo before he passed. 🤍
Jill