-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Roundtrip function #759
base: master
Are you sure you want to change the base?
Conversation
@afischerdev Thanks for this long awaited feature! 👍
Can you explain more how this parameter works? Some routers have a seed parameter to get different tours. Is this something to consider for BRouter or it generates the same route for the same parameters? |
@afischerdev What is this distance? Not length of the route (as in other routers)? |
may be better: It replaces the default of 20 with e.g. 45 degree.
Both are correct. |
@afischerdev Is it also available in BRouter test server? |
We have two via point and this is the distance start point to via point.
No, I could port it, but we currently don't have a web client that could take advantage of this new feature. |
@afischerdev So, if we set |
The direction is something like a main angle we want to place the route. E.g. North of parking space |
@afischerdev Thanks, also for the image, now it is clear! 👍 |
@afischerdev It would be interesting if the |
@afischerdev What Even if we use a large Is it because the distance is a strict requirement in the calculation? |
@afischerdev I mean if we can avoid round trips like the following with u-turns on the via points: |
Yes, I'll prepare that.
Yes, these routes doesn't look very well. I used |
Some mere results: The current version (add angle = 20, no misplaced correction) produces this routes (direction 0 to 315, step 45 deg): the new version runs with an add angle of 45, missplaced correction and a nogo point in angles center Not perfect but a little bit better results. Source coming soon. I will change the new same way back function. |
I'm really looking forward to this feature. I use it a lot in Garmin Connect (Web) and directly on my Garmin Edge device to just go for a new lap of running or cycling without worrying too much about the details of the route. I actually asked about this feature @mjaschen last autumn (in German): https://en.osm.town/@mcliquid/113517162799095813 One thing that we could learn from Garmin (actually Strava used to offer this feature, but it's no longer available) is to take elevation into account. Where I live, I have very steep mountains on one side and a wide valley on the other. trailrouter.com has actually a few settings, including the elevation setting. See also their help page. My technical experience is probably not enough to install BRouter local and test it, but as soon as there is a beta available, I would be very happy to volunteer as a tester! |
The last commits enabled a same way back function for both: normal routing and round trip routing. This will also work when via points are used. But it doesn't necessarily have to be the same route back. |
@mcliquid
|
@afischerdev I tried the allowSamewayback=1 should be like the old routing where we allow the same way back. |
@afischerdev Also it seems the waypoints (by user) are modified by the routing engine? e.g. we have 2 user waypoints Start + End on a highway with distance a few kilometers. |
May be I didn't understand
with same way back on we have
No, the nogo point is added only for roundtrip. |
Sorry, that's not what I meant. What I mean is an option that in normal routing can avoid using the same roads. @afischerdev What is a waypoint with radius but with |
This is done by using
allowSamewayback=1 - Ok, if not like, just don't use. |
The standard for a waypoint is isNogo=false. Please see the OsmNodeNamed This class is used for both nogo and not nogo points. And we start with a list of OsmNodeNamed for the waypoint collection. |
|
||
OsmNodeNamed onn = new OsmNodeNamed(new OsmNode(pos[0], pos[1])); | ||
onn.name = "via1"; | ||
onn.radius = 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afischerdev Here why do we set a radius
?
As this a via point, not a no-go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devemux86
The radius is also used for distance to the nearest road calculation.
I think it is from the beginning of this project, where the dynamic distance wasn't there and I tried to have a slightly larger radius.
But this is redundant now. I will remove it
@afischerdev So the recommendation when generating round trips is the following?
|
@mcliquid The data for your wishes is available in the routing tiles. But they are only out when a route is calculated. This could mean that routing in all directions is necessary to find an optimum. I don't like that very much. So I hope to find a shorter way. |
@devemux86 |
Here comes the new engineMode for roundtrips.
Parameters to play with:
direction - angle around start point (default random)
roundtripDistance - distance from start point (default 1500m)
roundtripDirectionAdd - changes the angle added to the direction (default 20 degrees)
allowSamewayback - go back the same way (default false)
exportWaypoints - export the generated points (default false)
profile:correctMisplacedViaPoints - correct the results (default false)
profile:correctMisplacedViaPointsDistance - distance for correction, 0 = don'r check distance (default 40m)
some samples:
direction = 90
direction 360 correctMisplacedViaPoints off
direction 360, correctMisplacedViaPoints on
direction 180 roundtripDirectionAdd 45deg
direction 360 allowSamewayback true