Distance measurements from point to point along a line feature class

5884
25
01-24-2015 09:29 PM
CoyPotts1
Occasional Contributor III

I am running ArcMap 10.2.2 on a Windows 7 machine.

 

I am wondering if it is possible to measure the distance from multiple points along a line feature class back to a single point.

 

Essentially I have a layer of points that are all routed back to a single location in another layer through a line feature class.  I would like a way to automate an output that gives me the measurement from each point back to the single point.  There are line segments that would need to be accounted for in the path for multiple points at times. 

 

The below image gives an example of the three feature classes that I have.  The one contains multiple points that are all routed back to a single "hub" location via a line feature class.  I need an output that measures the line distance back to that "hub" location from each individual point feature.

 

snip.JPG

0 Kudos
25 Replies
CoyPotts1
Occasional Contributor III

Hi, guys, I just wanted to check back in here and see if either of you have had a chance to take a look at the sample data yet. 

Thanks again for the assistance thus far.

0 Kudos
XanderBakker
Esri Esteemed Contributor

Nope, sorry. Will give it a look.

Edit: You mean from each node to the hub using Fiber as network, right?

0 Kudos
XanderBakker
Esri Esteemed Contributor

Looking at your data, there are no nodes at intersecting lines, nor at the location of the node points in your node shapefile. This will need some editing to make it work...

0 Kudos
CoyPotts1
Occasional Contributor III

I'm a little unsure of what you mean, but I will wait for your response to get a better idea.

Thanks!

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Coy Potts‌,

Since you want some more explanation on what I mean, here goes:

The Dijkstra Algorithm works with a network. This means as much as; each line that connects to another line should have a node at the connection. A node is the beginning or end of  a line. When using the Dijkstra Algorithm the data is simplified to a list of nodes (start and end points of the lines) and for each node a list of nodes it directly connects to including the distance between the nodes.

Based on this lists of nodes ("graph" as it is called), the network analysis is performed.

It will only succeed it the start and end points correspond to nodes in the network. If a point is located in the middle of a line or not even on the line, is has no connectivity and will not be able to yield a result.

In your case there are lines that are not "connected". Furthermore points are not located at nodes and sometimes not located on the lines. To be able to (partly) calculate your data, I had to snap points to the lines, split the lines at the points and had to split the lines where the connected to a vertex rather than a node.

Furthermore, I had to change the code to be able loop through the nodes shapefile and calculate a result.

If this is representative for the data quality you have, then I strongly recommend that you don't use my solution. It is just too much work to correct your data and make it suitable for the analysis.

The solution offered by Darren Wiens could be a solution, and the precision can be increased when you reduced the cell size. It is probably the easiest solution. The distance will always differ a fraction from what you could obtain in vector format, but maybe it is small enough to make it acceptable.

I like the solution offered by Dan Patterson and if he has time to correct that last tiny error that was happening, this will be the best solution for your data in my opinion.

Kind regards, Xander

XanderBakker
Esri Esteemed Contributor

Just looked a little closer at the data with respect to your comment on the precision required. I looked at the southern most points which are located in your data. Darren calculated a distance of 234 meters, while manually measuring the distance between the two points yields 231 meters. There is a difference of 1.2% between the two values.

Looking into more detail, halfway between the points there is a spike in your fiber line which creates an additional distance of around 4 meters and therefor producing a result less accurate then the raster method which smooths the spike out (if the cell size is not defined too small).

spike.png

Furthermore, points are often not located on the line, but more than a meter away from the line.

So if accuracy is what you need, your data will need some serious attention.

CoyPotts1
Occasional Contributor III

I didn't take the time to double check the data that I sent out, but when we create the data here in-house, we snap everything.  My company has a reach across the entire United States, and there are certain regions who like to go at it in their own way and have contractors do the GIS work.  They then send a KMZ back for us to convert to shapefile and then load into our SDE so we have a record of the data, but judging by the quality of the data, I wouldn't be surprised if they created the data in Google Earth to begin with.  There are a lot of instances where there are spikes, and nodes are never snapped to the lines.  I simply chose a small enough dataset to have test runs on, but I should have checked it better before attaching it.

Hitting on the topic of the 1.2% discrepancy, I would only assume that that percentage could potentially grow the longer the line segment was, right?  Either way, a potential of 1.2% over a 50 mile fiber network could be in the ballpark of 3,000'+, which could sway our cost model quite a bit.  Agreeably, this method would work in certain instances, but we're trying to find a standard method for all networks if possible.

0 Kudos
DanPatterson_Retired
MVP Emeritus

I tried it quickly, but there was an error in that the EMST produced from the fiber shapefile, took a shortcut since a shorter path was found than the one given.  I haven't had time to constrain the path to connections along a line...that would be the purpose of network solutions like Xander Bakker‌ proposed using Dijkstra's.  The Euclidean Minimum Spanning Tree finds the shortest path connecting a set of points.  In the incarnation attached, I specified a start node and let it fly on the points that make up the fiber shapefile.  At least connections were made except for the noted mislink.  So EMST is best to find the unconstrained linkage between points, where Dijkstra's would be the constrained linkages between points... Anyhow, here is the attached and the output table with its distances (maybe you should modify your trail system )

Error_01.jpg

0 Kudos
CoyPotts1
Occasional Contributor III

Yes, this looks pretty much like what I'm wanting.  The fiber paths chosen are based on existing aerial fiber, so there is no way to alter that

Can you post a screenshot of the parameters that you used in the tool, please?

0 Kudos
DanPatterson_Retired
MVP Emeritus

But there are those pesky errors...in any event here is what I did since I can't do a screen shot now

convert the paths to points

ran the tool with the second option...connections with point 0 as the start point and EMST as the output type

I then calculated the output segment result length

In the interim, since you already have the network why don't you use Xander's network solution

0 Kudos