Skip to main content
Solved

ShortestPathFinder & offroad shortcuts

  • August 17, 2020
  • 8 replies
  • 108 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
  • 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
  • August 18, 2020

Heyhey! There is just a gap :/


deanhowell
Influencer
Forum|alt.badge.img+24
  • Influencer
  • 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
  • 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
Evangelist
Forum|alt.badge.img+51
  • Evangelist
  • 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
  • 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
  • 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
  • August 18, 2020

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