Using ArcGIS Pro Advanced license 3.0.3

I have a dataset of 200 or so lines. The task is to calculate the distance between these lines on the right and the left of the line at given intervals. Essentially I am wanting to programmatically do what the Distance and Direction tools are doing on a one by one manually created basis.

The output should be a table that exists with the originating point FID and the closest line FID on the right of the line which the point originated from as well as the closest line FID to the left of the line which the point originated from.

Does a tool within ArcGIS exist that can do this type of analysis? Or a string of tools that I can create a repeatable process

Historically when I get Python answers on this site, I do not know enough to modify the python code in order for it work for my task... just being up front on that front!

  • Do you have cases when 2 lines on the left are both closer than line to the right?
    – FelixIP
    Jan 18, 2023 at 3:17

1 Answer 1


Why not use the Generate Near Table to return multiple near features to your input feature. It gives you a table with all your requested information. You can use the NEAR_ANGLE field to determine if the object is on the left or the right

  • When I use Generate Near Table it leaves my near distance field blank. That does work for Near Angle, however I need a measurement from both sides of the line as well.... so trying to think through that
    – Meg0
    Jan 17, 2023 at 22:01
  • I have figured out why my near distance field comes up blank... because my points exist along my line it is assuming that the nearest line to the point is on the line. So in searching for Nearest Feature I need to somehow programmatically exclude the feature that the points exist on.
    – Meg0
    Jan 17, 2023 at 22:30
  • Use Select by location, Intersect, invert_spatial_relationship to find features that do not intersect before the Near operation. Jan 17, 2023 at 22:45
  • Very helpful! Thank you!
    – Meg0
    Jan 17, 2023 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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