ArcGIS Desktop – Drawing Lines Between All Possible Combinations of Points

arcgis-desktoplineNetworkpoint

I have a shapefile with several points (A, B, C, D, E,…) and I want to draw a line between all possible combinations of points (A-B, A-C, A-D, B-C, B-D,…).

As I know that it is quite simple in ArcGIS I don't want to use a Python-script or something similar. The "Points To Line" tool just draws me one line that is connecting all the points (A-B-C-D-…).

How can I do it using ArcGIS Desktop (all extensions available) ?

Best Answer

WORKFLOW:

arcpy.SpatialJoin_analysis("points","points", "D:/Scratch/many.shp","JOIN_ONE_TO_MANY","INTERSECT", search_radius="1000000 Meters")
arcpy.SelectLayerByAttribute_management("many", "NEW_SELECTION", """"TARGET_FID" = "JOIN_FID"""")
arcpy.DeleteFeatures_management(in_features="many")
arcpy.AddField_management("many", "FromTo", "TEXT")

calculate field using:

str(sorted([ !TARGET_FID!, !JOIN_FID!]))

Convert points to line:

arcpy.PointsToLine_management("many", "D:/Scratch/lines.shp", Line_Field="FromTo")

RESULT:

Results

Related Question