I have 16 town point shapefiles. I have a layer of 2900 centroids for lots.

I need to determine the nearest town for each of the centroids.

The option I came up with is to Split by Attribute by name, thus creating 2900 point layers for the centroids, then doing the Near tool for each centroid. This will take a long time and may even crash ArcMap. There is probably a script for it, but I am very new to python.

enter image description here


There is no need for a script.

  1. Start by merging all the towns into one point feature class.

  2. Generate Near Table with Lots as input_features and the merged Towns as near_features:

Calculates distances and other proximity information between features in one or more feature class or layer. Unlike the Near tool, which modifies the input, Generate Near Table writes results to a new stand-alone table and supports finding more than one near feature.

  1. Join Towns to the Near Table.
  2. Join the resulting table to the Lots
  3. Export to a new feature class

You will now have a feature class of all the lots with information about the closest Town.

  • Do you know why the Near Table came out blank? – Amy Boddah Nov 2 '17 at 14:44
  • No you probably did something wrong. Are the feature classes in the same coordinate system? You could also try on a selection of you data. – BERA Nov 2 '17 at 14:45
  • I got the Table to work - changed the coordinate system - thank you. But how do I add the Towns to the Near Table when there are only 17 features and 2900 in the Near Table? – Amy Boddah Nov 2 '17 at 15:21
  • @AmyBoddah if you dont need the distance information you could do Spatial Join with match option closest – BERA Nov 2 '17 at 15:22
  • Ok nice. You need to join them together. Right click the table and then join – BERA Nov 2 '17 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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