Cycling_road with preference=shortest is routing through walking paths

Hi,

After some users of my app reported, I looked into it and realised that routes for road bikes are being created though walking/hiking paths. Here is one example which I created on ORS maps -

https://maps.openrouteservice.org/#/directions/Can%20Gusi,Ribas,CT,Spain/Rue%20Sanilles,Saillagouse,France/data/55,130,32,198,15,97,4,224,38,9,96,59,2,24,5,192,166,6,113,0,184,64,38,0,232,4,96,13,148,129,216,4,224,21,130,129,152,0,97,170,198,0,231,221,128,104,1,98,41,226,197,27,214,47,137,149,122,108,3,113,20,111,148,149,10,20,107,213,106,95,13,70,140,122,242,35,211,126,98,138,122,53,31,191,15,16,92,64,64,0,234,158,4,68,216,114,128,5,229,0,45,174,98,109,174,222,128,128,3,55,128,1,183,69,199,0,4,243,5,10,64,7,48,5,164,14,69,130,177,0,15,66,15,70,135,68,67,0,139,196,192,0,177,128,196,197,65,0,5,242,170,0

The problem also seems to be happening with (mode=cycling-regular, preference=recommended). However, for (mode=cycling_road, preference=recommended), this is not happening as far as I’m seeing.

Is this a bug in the routing engine or in the passed parameters?

Thanks.

Hi @abhiank,

the footway is tagged with bicycle:yes which indicates, that bicycle usage is allowed. cycling_road has higher priority for smooth surfaces and normal roads, which is why it will prefer them over the footway with surface:earth

Best regards

Hi @amandus ,

Apologies for the late reply. Regarding the issue, shouldn’t footways with surface:earth be completely avoided for road bikes? Unless a road bike is fitted for gravel riding, such a pathway seems completely unsuitable for road bike riding with thin tyres and low traction.

Also, on the same route, should’t this path be avoided since the surface value is unknown? I had assumed that for road bikes only paved surfaces are used - is that not true?

Best Regards,
Abhimanyu

@abhiank

take a look at the road bike flagencoder

surface:earth will receive a really low speed (2km/h) and is therefor usually avoided except a detour would go a really long way around.

For the path you mentioned it seems the value for highway: path is used which is 10 km/h.
If you have improvement suggestions, please also open an issue in the backend repo.

Best regards

Hi @amandus

I went through the RoadBikeFlagEncoder and tried to understand what the code was trying to do but I didn’t understand much. I also went though this documentation - Travel Speeds - openrouteservice documentation

Can you tell me how the speed of different waytypes factor into the algorithm to choose a certain route? I tried to look for more info on how ORS worked internally but couldn’t find much.

Also, is there a way I can set such that paths with surface earth be avoided for road bikes in the current API?

Thanks,
Abhimanyu

Hi @abhiank,

This is not possible with the current API.

The speeds set in the flagencoders transfer rather directly into weightings on the graph. There are however some further priority settings in the collect function of both the RoadBikeFlagEncoder and the CommonBikeFlagEncoder, which can in- or decrease the used weighting.

Best regards