zhengniu

Is it possible to use varying search radius to generate near table

Discussion created by zhengniu on Nov 5, 2012
Question:

In my case, I have a point feature class and want to create a near table to itself based on each point's accuracy in meter, which means both parameters (in_features and near_features) are the same FC "point"

Point Fc (e.g."points") has following attributes: OBJECTID, Shape, X, Y, Accuracy
In standalone python script, I used:

inFc = "points"
nearFc ="points"
outTable="point_nearT"

searchRadius= dist # Where I want dist is a variable that use each point's accuarcy
location="NO_LOCATION"
angle="NO_ANGLE"
closest = 'ALL'
arcpy.GenerateNearTable_analysis(inFeatures, nearFeatures, outTable, searchRadius, location, angle, closest)

My thought is:

write a For loop for inFc:
create a feature layer for each point
use arcpy.GenerateNearTable_analysis(inFeatures, nearFeatures, outTable, searchRadius, location, angle, closest) to create an outTable for this point, named as outtable_i (where i in range(numeber of points in inFc)

After finishing the For loop, merge all outtables into one.

Since I have over 128k points in inFc, it may take hundreds hours to finish. Please comment on this. it is highly appreciate for your help

Outcomes