Select to view content in your preferred language

How to skip some values when labelling point on top of each other

840
6
05-02-2022 04:00 AM
Labels (3)
VaL
by
Occasional Contributor

Hi all,

I have some point which are on top of each other (duplicated). They have same name Dont ask why 🙂

When I label them with their name, I get 3-4 labels. 

Is there a way to label only one of them, the other labels just make the map messy.

I did try with python, but I am not getting what expected.

Here is my code, I use in the label properties dialog:

def FindLabel ( [LocationID] ):
ll=open(r'c:\Users\lefte-va\test1.txt').readlines()
if [LocationID]+'\n' not in ll:
with open(r'c:\Users\lefte-va\test1.txt','a') as myfile:
myfile.write([LocationID]+'\n')
return [LocationID]

This returns empty(no label values).

Any ideas?

0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor
0 Kudos
VaL
by
Occasional Contributor

Thanks Dan. 

However they need to remain duplicated. 

This is inherited data, so I can not do much to improve it. Otherwise it must be one to many relationship and all rosy. 

So the question still remains. 

More over I am surprised my code doesn't work. Any idea why?

0 Kudos
carriemorrell
New Contributor

If you can use the Maplex labeling, the Remove Duplicate Labels (within a fixed distance) usually helps. 

VaL
by
Occasional Contributor

As far as I remember, maplex required separate license. Is that so?

0 Kudos
carriemorrell
New Contributor

Its not separate, but I believe you need to have an advanced or standard Desktop License

0 Kudos
JesseWickizer
Esri Contributor

In ArcGIS Pro, Maplex is available at all license levels. As @carriemorrell suggested, the Maplex Remove duplicate labels setting will remove the redundant point labels in your situation. 

0 Kudos