I have points representing sample locations. Often, multiple samples will be taken in the same location: multiple points with the same location but different sample IDs and other attributes. I'd like to label all points which are co-located with a single label, with stacked text listing all the sample IDs of all the points in that spot.
Is this possible in ArcGIS using either the regular labeling engine or Maplex? I know I could work around this by creating a new layer with all the sample IDs for each location in one attribute value but I'd like to avoid creating new data just for labeling.
Basically I want to go from this:
To this (for the topmost point):
Without doing any manual editing of the labels.
Best Answer
One way of doing this is cloning the layer, using definition queries and labelling them separately, using upper-left only label position for the first layer and lower-left for second.
Add THEFIELD type integer to layer and populate it using expression below:
Call it by:
Create a copy of layer in the table of content, apply definition query THEFIELD=1.
Apply definition query THEFIELD=2 for original layer.
Apply different fixed label placement
UPDATE based on comments to original solution:
Add field COORD and populate it using
Summarise this field using first and last for label. Join this table back to original using COORD field. Select records where firs<>last and concatenate first and last label in a new field using
Use Count_COORD and THEFIELD to define 2 'different layers' and fields to label them:
Update #2 inspired by @Hornbydd solution:
UPDATE November 2016, hopefully last.
Below expression tested on 2000 duplicates, works like charm: