Skip to main content
Solved

ShortestPathFinder & offroad shortcuts

  • August 17, 2020
  • 8 replies
  • 39 views

hlynur
Supporter
Forum|alt.badge.img+10

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 X), 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?

Best answer by markatsafe

@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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

deanhowell
Influencer
Forum|alt.badge.img+24
  • Influencer
  • 315 replies
  • August 18, 2020

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


hlynur
Supporter
Forum|alt.badge.img+10
  • Author
  • Supporter
  • 35 replies
  • August 18, 2020

Heyhey! There is just a gap :/


deanhowell
Influencer
Forum|alt.badge.img+24
  • Influencer
  • 315 replies
  • August 18, 2020

Heyhey! There is just a gap :/

Do you have some sample data you could share?


hlynur
Supporter
Forum|alt.badge.img+10
  • Author
  • Supporter
  • 35 replies
  • August 18, 2020

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).


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • August 18, 2020

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.


hlynur
Supporter
Forum|alt.badge.img+10
  • Author
  • Supporter
  • 35 replies
  • August 18, 2020

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 💁


Forum|alt.badge.img+2
  • 1891 replies
  • Best Answer
  • August 18, 2020

@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.


hlynur
Supporter
Forum|alt.badge.img+10
  • Author
  • Supporter
  • 35 replies
  • August 18, 2020

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