Near Tool on repeated selection sets

Discussion created by on Jan 4, 2012
Latest reply on Jan 17, 2012 by
I am trying to calculate nearest neighbor distances for a group of mutually exclusive selection sets.  So, for each iteration (though I am doing this manually - I have not been able to get the iteration work right so I dropped it) I select a set of points for the target points, and a set of points for the near points.  Each time this populates the target points with the distance to the nearest "near" point and the "near" point id.  This is all fine.  The problem is that I have to re-run this for 22 different selection sets of target points, and each time it populates -1 for the unselected target points, and therefore wipes out the previous distance calculations.  I tried running it by using a select by attributes and a definition query, and it did the same thing (only populated the last iteration and wiped out the previous iteration).  Is this something that can be avoided?

I realize it might be possible to run this with a spatial join and then collect and combine all of the outputs, but I had hoped to do this without creating 22 different feature classes.

FYI, I am a novice who has no experience with PYTHON.

Thanks, in advance, for any help you can offer.