Skip to content
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

Add switch to not use offroad #32

Open
Wizit38 opened this issue Oct 13, 2021 · 5 comments
Open

Add switch to not use offroad #32

Wizit38 opened this issue Oct 13, 2021 · 5 comments

Comments

@Wizit38
Copy link

Wizit38 commented Oct 13, 2021

Is it possible to add a switch to use only paved roads and cycleways?

Sometimes on a tour you are really tired or you are not confident of riding offroad. It would be nice to have a switch to force the route not to be offroad under these times.

Best Regards

@utack
Copy link
Owner

utack commented Oct 13, 2021

Hi,

thanks for your idea.
I will have to think about it a bit before finding a good solution

For now can you test if this works for you
https://pastebin.com/pYsz3JQH

Please find a new parameter "smoothness_limit" in line 38 that you can play with for a bit, something like 0.4 as I have applied now should quite strictly only give you roads in excellent conditions
Something like 0.8 should probably also still be ok in slightly "tired" conditions, but would allow some unpaved roads

@Wizit38
Copy link
Author

Wizit38 commented Oct 13, 2021

thank you so much. I will try it later.

@Wizit38
Copy link
Author

Wizit38 commented Oct 13, 2021

The value worked nicely on the route I tested on. It originally routed on a dirt track but now routes along paved roads. Thank you for this

@Wizit38
Copy link
Author

Wizit38 commented Oct 14, 2021

Btw, I found that 1.25 seems to be the threshold to switch back to the original profile

@Wizit38
Copy link
Author

Wizit38 commented Oct 14, 2021

Based on this, I implemented the following:

switch to use paved roads only

assign paved_routes_only false

the maximum smoothness penalty a way may have before we avoid it

assign smoothness_limit = switch ( paved_routes_only ) 0.4 1.25 # Set to 0.4 to use paved roads, >1.25 to allow dirt tracks

Sorry about the bold text. Seems it bolds text after #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants