Distance between two linear features?

18876
15
Jump to solution
01-15-2012 07:01 PM
PhillipeWernette1
Emerging Contributor
I've been searching and searching for a way to calculate the minimum and mean distance from one line feature to another line feature. I'm dealing with several decades worth of shorelines for each one of my four different sites for my thesis. Currently I have a script written that cycles through each of the sites and runs an analysis from one shoreline to every other shoreline at the same site then moves on to the next year at that site and does the same thing. Right now it begins at a distance of 0.05 meters and incrementally increases a buffer around the first line until the buffer encompasses a threshold percentage of the second shoreline. I understand that this is somewhat repetitive, but that is ok. I would rather include distances for both directions. So my question is: is there a clean way to calculate the minimum and/or average distance from one line feature to another line feature? If so, how might this work? It seems like a fairly straightforward concept to calculate a set of distance statistics from one line to another (yes, I would like direction to matter as it is important to me if A to B is not the same as B to A for some reason), but I cannot seem to find how to implement this. Any help here would be much appreciated.

-Phil
------------------------
Michigan State University
Department of Geography
MS Graduate Student
15 Replies
ShawnLeroux
Emerging Contributor
I am interesting in the perpendicular distance between a pt and a line and it seems that based on the link you sent (which makes intuitive sense!), the shortest distance between a pt and a line is necessarily perpendicular.
But you suggested that the shortest distance between a pt and a line is not necessarily perpendicular. Can you explain?
Thanks for your help!
Shawn
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
In the attached drawing:
- The shortest distance from the blue point to line A (found by Near tool) happens to be the same as the perpendicular distance.
- But the shortest distance from the blue point to line B (found by Near tool) would be the green-dash line, which would NOT be the same as the perpendicular distance (red line) found on the extension (grey-dash part) of line B.

The NEAR_DIST values you get from the Near tool are the shortest distance from a point to a line, but not necessarily the perpendicular distance.

Hope this helps you understand and determine what distance you need for your analysis.
ShawnLeroux
Emerging Contributor
Excellent illustration.
I get it now.
Thanks!
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
You are welcome. I am glad to help.  🙂
0 Kudos
LucyGoodman
New Contributor

A nice n easy, neat solution- thank you!

0 Kudos
WalkerKB
Occasional Contributor

This has been great!  Thank you all (especially Dan) for the help.  Like at least one other person, I'm looking at shifting coastlines.  The Near tool distance is basically giving the absolute value of distance, ie there are no negative numbers irrespective of direction of change.  Visually, I see segments of positive shift and areas of negative shift.  Is there a way to specify the direction with a negative relative to the initial input instead of angle and the distance?

0 Kudos