Hey,
while checking to upgrade to a more recent graphhopper version we tripped over handling of access restrictions for speed pedelecs.
Previously we relied on CountryRules and handled them somehow as motorcycles, country specific wise.
Now looking at the AccessParsers I see only handlers for cars, foot and bike . I am not tripping over specific handling of motorcycles, for instance.
May I ask for advice how to support country specific S-Pedelecs road access rules?
Do we need to create an handler on its own, or should we write a custom model with speed = 0 for ways not allowe, for instance ?
Best,
Olaf
Good question. You can probably do both.
If there are different access rules per country I would create a new RoadAccessDefaultHandler. Probably you would need to know that there exists such a vehicle type in the various countries. Also the GraphHopper side (unenforced) requirement would be that you currently need a separate XYRoadAccess and you would need to create a separate TransportationMode, which roughly models the access tree available in the wiki.
Do we need to create an handler on its own, or should we write a custom model with speed = 0 for ways not allowe, for instance ?
Yes, possible too and this is probably quicker to implement. And if put into a separate custom model you can use it for multiple profiles too. But could be a bit cumbersome for certain access rules to express them in the custom model JSON.
Note: I would use a priority of 0 as it makes the intent more clear IMO.