I would like to provide a routing mode where bicycles would be allowed on roads with vehicle=no. In our country there are many roads with traffic sign restricting access to all vehicles, even they actually mean only motorized vehicles as they forget about cyclists. Is somthing like this prossible with custom_model_file ? If yes then how?
Currently every custom profile is based on a FlagEncoder (letâs say a âvehicleâ). For every road/edge we store âaccess flagsâ for every vehicle. These are simply boolean flags that determine whether a road should or should not be accessible for a certain vehicle. For example all access flags for motorways are set to false for the bike and foot vehicles. Using custom profiles you cannot change this yet, but we are working on this. So if a road is blocked for bikes you cannot simply make it accessible using a custom model without changing the GraphHopper code. In some cases you might be able to use a FlagEncoder that does not block the road you want to use in the first place, because closing roads using custom models is always possible.
Thanks for your answer. Just an idea, wouldnât it be for such cases better to keep the restricted roads and assign them high weight (maybe even infinity)? Or would it (considerably) slow down the routing (or use more memory)?
Also, if access for bike is restricted but allowed for pedestrians, then it should be considered with weight of âpushing the bikeâ. I have already reported it at https://github.com/graphhopper/graphhopper/issues/2271.
Yes, there is certainly room for improvement and we are currently working on this. We are thinking about deriving the access flags from the custom profiles. So we can include/exclude arbitrary roads based on custom models.