ArcGIS 10.2 Label Removal – How to Remove Multiple Labels for Stacked Points in ArcGIS 10.2.2

arcgis-10.2arcgis-desktoplabelingoverlapping-featurespoint

I have a point feature class, in certain areas there are stacked points. These stacked points are accurate. However, when I label the points I am getting a label for each point, which is okay for each unique attribute that is being displayed. However, there are some points that have the same attribute information being displayed, where I would only like one label.

Example:

enter image description here

How can I display one label for all stacked points if their attribute information is the same? So that it would look like:

enter image description here

Any thougts? I am using a point feature class from ArcSDE 10.2.2.

I cannot alter that data in any way and I am required to used this dataset. Also, I will be publishing it as a dynamic mapping service and documentation has suggested that Maplex Label Engine is not recommend since it slows down performance.

I am looking for a work around taking account into these requirements.

Best Answer

Approach 1: Maplex Remove Duplicates

First, make sure you are using the Maplex Label Engine by checking the box in the Labeling toolbar. You can also set the Maplex Label Engine to be the default in Customize > ArcMap Options > Data View tab > Default Labeling Properties.

Maplex

Second, check the Remove duplicates box in the Label Density tab of the Placement Properties of the layer you are labeling. You can also customize the radius in which duplicates are searched.

Remove duplicates

Approach 2: Label classes

If you can't use Maplex (as you've noted) or you are labeling coincident points by a field with unique values for each feature, we need to take a different approach. First, add a new integer field called Label to your attribute table.

Second, in field calculator, flag duplicate records by running a special field calculator expression on your new field. Use the expression isDuplicate(!Shape!), assuming Shape is the name of your geometry field, the PYTHON_9.3 parser, and the following Python code in the optional code block. This will flag the first instance of each geometry with a 0, duplicates with a 1, and null or invalid geometry with a -1.

uniqueList = []
def isDuplicate(inputShape):
    if inputShape is None or inputShape.pointCount == 0 or inputShape.firstPoint is None:
        return -1
    else:
      hashableShape = (inputShape.firstPoint.X, inputShape.firstPoint.Y)
      if hashableShape in uniqueList:
        return 1
      else:
        uniqueList.append(hashableShape)
        return 0

Field calculator duplicate identification

Then, you can use label classes to only label features that have a 0 in the Label fieldvia a SQL query. This should remove duplicate labels.

Label classes

Related Question