I am using ArcMap 10.4.1 – Basic use.
I have to determine for each point (leak), how many lines (pipes) there are within a certain distance (Spatial join – within a distance of).
Then I have to proceed with this filtered dataset and determine the distance from that point to all lines within a certain distance. I want the same calculation method as closest, but then for all lines and not only the closest. Additionally, a line can be in a certain distance of multiple points.
As I make use of the basic license, I do not have the option of using the proximity toolbox (near tool). Is there a workaround to determine the distance from a point to all lines within a certain distance?
I already thought of the tool points to lines, but as this is a many-to-many relationship it is not possible directly.
Best Answer
Script below designed to run from mxd. It assumes that you have empty a table (“nearLines”) to populate in mxd:
Where pointID and lineID are fields to store OIDs of input layers (type long), Distance field type double.
I hope there are enough comments in script to understand it’s logic...
It took 1 min 8 seconds to process 1000 points and 1200 lines on my rather solid machine. I summarised nearLines table, points below coloured by count of lines within 100 m:
Learn Python and you’ll be able to work around licensing limitations, e.g. this and sometimes absence of extension.