Some Road Segments not Showing/generated

Hi,

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)

Anything wrong on my local deployment? Any inputs are welcome.

Thanks!

Hi,

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”.

The area in question: https://www.openstreetmap.org/way/28294916

I checked one of the gates – https://www.openstreetmap.org/node/7098815254 – which is not marked as passable. After skimming over https://wiki.openstreetmap.org/wiki/Tag:barrier%3Dlift_gate, I assume that appropriate access-tags need to be added to the gates. If you know the area, you could probably determine the correct access-tags if any :wink:

Best,
Jan

2 Likes

hi @lippertsjan

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?

Regards
Naul

Hi,

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).

Regard,
Jan

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?

No its the number of nodes each sub network must have to not be removed, see the docs here:

1 Like

You can reverse this default behaviour for potential barriers with:

graph.flag_encoders=car|block_barrier=false

without changing the code

1 Like
Powered by Discourse