I’m a new Graphhopper user and currently exploring Graphhopper.jar on my local computer. I downloaded OSM PBF and rebuild it using default config file. I noticed that some of the road segments seems not generated on the graphhopper, I ticked the local MVT. Most of the road segments are having lift_gate or swing_gate tags on OSM. Is this expected? I attached screenshots the grey-colored line is the one that shows as local MVT layer on graphhopper UI, I opened the pbf file on QGIS to make sure that the pbf file has road segments on that particular area as you can see on the second screenshot image (blue-line)
this behaviour seems to be expected (see CarFlagEncoder.java#L83). According to this code, swing_gates and lift_gates are treated as “potential barriers”. According to AbstractFlagEncoder.java#L200 “movable barriers block if they are not marked as passable”.
thank you for the explanations! so just to clarify all road segments that have gate/barrier tags will not be generated in graphhopper unless it has passable access-tag?
yes, they need some tags that mark them as passable. I double-checked the code for the car encoder again. Taking both AbstractFlagEncoder.java#L206 and CarFlagEncoder.java#L67 into account, one or more of the keys
"motorcar", "motor_vehicle", "vehicle", "access"
with values
"yes", "permissive"
would add the roads to routing.
So, e.g., if these roads are “regular” roads with gates that can be accessed by any vehicle, I’d assume that “vehicle=yes” would be appropriate (see Key:access).
You can also try to set prepare.min_network_size: 0 in config.yml. GraphHopper first parses the OSM data and creates the road network, but then removes ‘islands/subnetworks’ that are not reachable from the main network. In this case the area on your screenshot is not reachable because of the gates. Setting above parameter to zero means no subnetworks will be removed (but they will still not be connected).
Thank you @lippertsjan@easbar !
So this network size parameter is a kind of search radius of Graphhopper to generates the reachable road network? I assume this is using meters unit?