# Measure average distance between two lines with common endpoints

I have two shapefiles, each with a set of lines generated from start and end points. One shapefile has the straight lines generated from the XY To Line tool, while the other has lines generated from a least cost path tool in Python. I am looking for a method to quantify the error or distance between them, something that attempts to capture the overall variation between the two lines, not just the greatest or shortest distance between them (The shortest distance would also be 0 as they have the same start and end points). I have considered closing them into polygons, then dividing the area by the straight-line distance to get an 'average polygon height'. I have also considered converting one set of lines into points and then averaging the distances generated from the Near tool for each line feature. However to do this I would have to delete the end points as they are essentially false '0' distances.

Are there other methods to compare these features? An important aspect to note is that sometimes the least cost path line crosses over the straight line so I would often have two polygons.

• There are infinitely many possible solutions to this problem. You could help narrow down the possibilities by explaining how you intend to use or interpret this measure of "distance," "error," or "variation." – whuber Apr 4 '14 at 16:31
• Basically it is just to put the difference created by the two methods (straight line vs least cost path) into context. It is not intended to show any sort of significance but to allow readers to mentally quantify the variation. If that makes sense? It is just to take the difference out of visuals and put some sort of number to it. – AlmaThom Apr 4 '14 at 17:09
• That leaves us little to go on. At least tell us what the intended basis of the comparison should be: will your readers be more interested in cost or distance? – whuber Apr 9 '14 at 13:38
• Would something like a Detour Index be appropriate? (See, for example, people.hofstra.edu/geotrans/eng/methods/ch1m3en.html) – Andy Jun 1 '15 at 14:34

I know this is an old post, but I look at this and the first thing that comes to mind is sinuosity.

Sinuosity is defined by the length along a polyline divided by the shortest distance from start point to end point. This seems like a reasonable metric for determining the difference between the two lines.

There are several posts on this site which relate to sinuosity.