..
I have a multi-part polyline with junction points along the line. I'd like to measure the distance of each junction points along the line from a single source point feature. All parts flow away from the source already. I am also trying to determine the length of each part from the starting point to the end point of each segment that branches off from the junction points.
Page 1 / 1
Error on the drawing... the blue colored junction points were meant to be the end points of every junction and not a junction point.
Hi,
In the case of such tree structure graph, I would try using the ShortestPathFinder.
(1) Send the polyline to an Intersector or a TopologyBuilder to transform it into network lines.
(2) Create from-to lines for each junction point so that each line connects between a junction point and the source point.
(3) Add a ShortestPathFinder; send the network lines to the Neetwork port; send the from-to lines to the From-To port.
(4) Calculate the lengths of the resulting shortest paths. The length is the distance measured along the path between a junction and the source.
Takashi
Deleted the previous comment and replaced with this.
Thanks for the quick response and I really appreciate your help. I got it to work somewhat but there must be something wrong with my network. Noticed two problems: the From To Builder builds paths "as the crow flies" from the source to each junction. Secondly, my results does not get into the Path output port of the ShortestPathFinder. I would think that the two are related. Please comment on my workspace when you have a chance. Below is a picture of my workspace:
There could be a problem on parameter setting of the FromToBuilder. Try using this process, instead of the transformer. This process is basically the same as the transformer definition.
(1) Extract coordinate (_x, _y) of the source point with a CoordinateExtractor.
(2) Add a FeatureMerger to merge the coordinate (_x, _y) to every junction point unconditionally.
Junction points --> Requestor
Source point --> Supplier
Join On: <set the same value (e.g. 1) to both requestor and supplier so that the unconditional merging will be performed>
(3) Connect a VertexCreator to the Merged port of the FeatureMerger to add the source point to each node point.
Mode: Add Point
X Value: _x
Y Value: _y
I followed exactly what you said and took a good bit of time to undersand how the FromTo and Shortest PathFinder works. Thank you very much and I appreciate the help.