# Finding distance between neighboring points in ArcGIS Desktop?

I have two shape files: one has point features indicating urban centers, the other is a polygon features file that has counties. Each county has one urban center. There are around 2800 counties. I want to find the distance between one urban center in a county to all of its neighboring urban centers (by this I mean centers located in counties that border the selected county)

For example, if county 1 borders county 3 and county 2, I would like to find the distance between urban center 1 (located in center 1) and center 3, and between center 1 and center 2. If county 7 borders county 8, 9 and 10, I want to find the distance between urban center 7 and centers 8,9 and 10.

So far I have tried the following:

1. I have tried using the Near Generate Table and the Near tool. The problem with this is that I do not only want to find the distance between points that are closest to one another, but rather find the distance between a point and all of its neighboring points.
2. I used the point distance tool, which gives me the point distance between every single point for all 2800 points, and this is very redundant and inefficient, since I only want to find the distance between neighboring point features.

Is there any way to do this in ArcGIS Desktop 10.3?

Solution below assumes:

• you are using ArcGIS Desktop 10.3
• you are working from mxd, name of polygon layer is PGONS, it has unique name stored in field PGON_ID and you transferred coordinates of centres into PGONS table and stored in fields as shown below: ``````arcpy.SpatialJoin_analysis("PGONS", "PGONS", "D:/Scratch/SJ.shp", join_operation="JOIN_ONE_TO_MANY", join_type="KEEP_ALL", field_mapping="""PGON_ID "PGON_ID" true true false 10 Text 0 0 ,First,#,PGONS,PGON_ID,-1,-1;POINT_X "POINT_X" true true false 19 Double 0 0 ,First,#,PGONS,POINT_X,-1,-1;POINT_Y "POINT_Y" true true false 19 Double 0 0 ,First,#,PGONS,POINT_Y,-1,-1;PGON_ID_1 "PGON_ID_1" true true false 10 Text 0 0 ,First,#,PGONS,PGON_ID,-1,-1;POINT_X_1 "POINT_X_1" true true false 19 Double 0 0 ,First,#,PGONS,POINT_X,-1,-1;POINT_Y_1 "POINT_Y_1" true true false 19 Double 0 0 ,First,#,PGONS,POINT_Y,-1,-1""", match_option="SHARE_A_LINE_SEGMENT_WITH", search_radius="", distance_field_name="") 