osrm-backend
osrm-backend copied to clipboard
Implement exclude flags for CH
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.
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.
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?
Did you re-run osrm-contract after updating the bicycle.lua file? That is a required step.
yes,I already run osrm-contract with the bicycle.lua file. I also want to know the key of ferry is route or highway?