osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

Implement exclude flags for CH

Open hahaking119 opened this issue 1 year ago • 4 comments

Hello, I would like to know if the CH algorithm already supports the exclude parameter. I set exclude = ferry when using it. If there is only one route and it contains a link with the ferry attribute, then this route will be recalled. Is this normal? thank you.

hahaking119 avatar Nov 10 '23 02:11 hahaking119

Yes, it's supported by the CH algorithm. You need to make sure that excludable is set in the Lua profile, like it is by default here:

https://github.com/Project-OSRM/osrm-backend/blob/master/profiles/car.lua#L123-L128

That setting will cause OSRM to generate multiple versions of the CH graph, each graph will have those edges removed. At query time, you can do exclude=ferry or exclude=motorway or exclude=toll and OSRM will perform the route calculation on the graph prepared for that option.

Every excludable you add to the Lua script makes the dataset bigger and causes processing to take longer.

danpat avatar Nov 10 '23 03:11 danpat

But I set the excludable parameter in bicycle.profile and specified exclude = ferry when calling the interface, and the engine still returns a result containing ferry. What is the reason for this? image

hahaking119 avatar Nov 10 '23 09:11 hahaking119

Did you re-run osrm-contract after updating the bicycle.lua file? That is a required step.

danpat avatar Nov 10 '23 14:11 danpat

yes,I already run osrm-contract with the bicycle.lua file. I also want to know the key of ferry is route or highway?

hahaking119 avatar Nov 12 '23 13:11 hahaking119