/Caroline
/Caroline
Cannot find problems from the screenshot.
Adjoining lines belonging to a network have to be touched at their end nodes each other.
Do all the gray lines satisfy the condition?
Takashi
I agree with Takashi, I cannot see any obvious problems.
However, have you looked at this article (https://knowledge.safe.com/articles/Samples_and_Demos/Find-the-Shortest-Path-Between-a-Start-and-End-Point)? In particular, there is a link to a video there on the ShortestPathFinder that might be of help.
David
David
I have used a snapping tool to create the shorter lines in the network so they should touch. I tried with extending the lines where the to point are to be sure. This didnt work eituer. On the other hand if I created points in the large netwokr (red lines) at the intersection i did get a path...
If the horizontal line consists of two individual lines in fact, which touch with the red point at their end nodes, the ShortestPathFinder treats the three lines (two horizontal lines and one vertical line) as a network.
But if the horizontal line is one single line A-C, the transformer will not treat it as a network, even if the line has a vertex at the point. Path between B and C can not be found by the transformer.
Again, the lines belonging to a network have to be touched at their END nodes each other. In other words, every line should be divided at intersection points. That's why vertex snapping is not enough but the TopologyBuilder could be effective, as David suggested.
David
I will try the AnchordedSnapper. menawhile, do you have any suggestion how to test if a network is useful for shortestpathFinder? The network Ive been asking about above is simple manually made (the red lines) and then snapping the point to it in order to make paths to the points. We have a more complicated network (roads) wich has a lot of gaps and dead ends. Its a mess really. We need a solif network to start with I guess, then we need to make sure all the lines are separated (as Takashi explained). Do you have any suggastions on how to check errors in a network? maybe even how to fix them ... . We have been using SmartCleaner. Does that do the trick? Can we check if the netwokr is compleatly fixed after that?
/Caroline
If you have the necessary license, the MRF2DCleaner can be very helpful when used with the "compute true intersections" and "compute fuzzy intersections" settings. But you will need a separate license for this transformer, though.
Other than that you can probably get a long way just by doing lots of random tests using the ShortestPathFinder and check that it actually produces something meaningful.
If you need to do more advanced checking, you could iterate over all the lines exiting the TopologyBuilder to check that _from_node and _to_node have been referenced in at least one other line segment.
David
The transformer adds network ID attribute (called "_network_id" by default) to output lines; if all output lines have the same network ID, you can say that they belong to the same network.
Note that the transformer just determines the topological connectivity of a network graph. There could be unpreferable gaps between lines even if they belong to the same network.
As David mentioned, you might need to go a long way of trial and error, depending on the data condition.
/Caroline