Skip to main content

Hello there, Im using the Shortest path finder transformer to analyse best routes from A 's to B's where the network is a road system. There is however a bit of flexibility in my project where the route could sometimes go "offroad" to skip going long detours. So i used my MS Paint superskills to explain what I mean.

 

route

 

Lets say that the black lines in the road system (network) and the yellow line represent the best result from ShortestPathFinder for getting from A to B. But it needs to take that tedious detour to west and then east again and i would want to allow it to take the green dotted detour instead (marked 😵, even if there is no road present there.

 

Pretty sure that the ShortestPathFinder does not have that option so I was wondering if anyone here has a suggestion how to solve this? And then in a way that you can set a snapping tolerance requirement for shortcuts (for example has to be max 10m a part for it to be allowed) or it wont happen. And in a way you can process multiple routes for multiple destinations at a time (my feature set has best routes for about 40K A's to about 10K B's).

 

How about it?

Hello @hlynur is there a physical line at x in the dataset or is it just a gap?


Heyhey! There is just a gap :/


Heyhey! There is just a gap :/

Do you have some sample data you could share?


Heyhey again, yubb, take a look at this shapefile, you easily see where it needs to take a detour west-east from the main-route from northeast to southwest. (as there is no road connection there).


I think you'd have to introduce these links into the network first in order to use them. I'm not sure how you'd achieve this automatically with a typical road network. Just because two roads are close by, doesn't mean you can traverse between them. I'm struggling to understand how you decide that the green detour is allowed - there could be any number of obstacles which mean that you cannot avoid the detour - rivers/buildings/one way systems etc.


Yubb, thanks for the input @ebygomm​ and that's my personal thought aswell, you are opening up to even more chaos by doing this. But that's what the client asked for so I just try to do my best to get what he wants 💁


@hlynur You could try creating the short-cuts using the NeighborFinder. Use Chopper to get the vertices on the line (Max. Vertices = 1) and then NeighborFinder to find closest points. Plus a bit of filtering to cleanup. It might work better on a street network rather the a single route (in the example you supplied the route duplicates itself which was confusing).

I've attached an example workspace (2020.1) - hopefully give you some ideas.


Hey @Mark Stoakes​ ! Thanks for this, will try it out.


Reply