I have 3 input datasets of points. What I'm trying to do is to assign a common ID code to the points that are close to each other (no specific distance).

I'm using a ModelBuilder to achieve this : first, i create a buffer around each dataset of points, then i combine the 3 buffers and dissolve it.

What I'm trying to do next is to assign an ID to points that are Inside the same polygon (combined/dissolved buffer), but this is where I'm stuck at...

I'm trying to use the Spatial Join but i don't understand how to separate the points.

  • 2
    Check out the documentation on the Spatial Join tool (pro.arcgis.com/en/pro-app/tool-reference/analysis/…). You might be performing the join in the wrong direction; If you join the buffer to the points you should be left with the point geometries and attributes from both tables.
    – crld
    May 2, 2016 at 15:59
  • That I can do, I do it in the right direction. However I don't know how to assign a similar code to the 3 dataset of points that are in the same polygon/buffer. @crld
    – Piki
    May 2, 2016 at 16:10
  • If you run a spatial join, joining the attributes of the buffer to the points surely you would have passed the ID of the buffer to the points and achieved your outcome?
    – Hornbydd
    May 2, 2016 at 16:26

1 Answer 1


If I understand correctly, your question is more about assigning a unique identifier to each cluster of points rather than an issue with doing the join. You can use the following methodology to assign a unique ID (that will work with model builder).

In your buffer layer, add a field (like bufferID or groupID) of type LONG. Right click the new field and select Field Calculator. In the field calculator window, select the Python Parser, and check the "Show Codeblock". Paste the following code into the "Pre-Logic Script Code" window:

def autoIncrement(): 
    global rec 
    pStart = 1  
    pInterval = 1 
    if (rec == 0):  
        rec = pStart  
        rec += pInterval  
    return rec

Below, in your field expression window (it'll say field =) type autoIncrement(). This will assign each row in the buffer layer an incremental ID that you can join to your individual point feature classes and subsequently use to relate points to one another between datasets.

The field calculator window should look like this:

enter image description here

EDIT: If you're doing this in model builder, I believe you'll have to specify "PYTHON_9.3" for the parser in the field calculator tool window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.