Graphhopper routing problem in standalone server and

I’m sorry if this is the wrong place to report this, I honestly don’t know where to report this.

There seems to be a part of map that graphhopper refuse to route. Please note OSRM routed these without problem.

Using the open source routing server I got error: Connection between locations not found

If this is not the place to report this, I’m sorry, and please direct me to the correct location. I don’t even know if it’s problem of the map or graphhopper haha

Thanks for reporting, you’ve come to the right place :wink:

It looks like this area is separated by gates (barrier=gate) (some with permissive access (access=permissive)) like this one: Node: 8682066110 | OpenStreetMap. GraphHopper does not allow passing these. At least not for cars. When you choose the Foot or Bike profile it works. When an entire area cannot be reached for a certain vehicle (like cars here) and it is below a certain size GraphHopper removes it entirely. This is why you cannot even calculate routes for cars within the gated area.

Do you have local knowledge of this area? Do you think cars should be allowed to pass these gates?

Yes, I am a local around these areas…
Yes, cars can definitely go pass these gates. They’re local clusters of housings, and the gates usually stay open on the day, and has people to open them for residences/guests in the night.

Sorry, I was a bit off. GraphHopper does not block barrier=gate for cars. So the problem is not caused by the gates. However, the roads are tagged as motor_vehicle=private, see here for example: Way: ‪Jalan Kembangan Utama‬ (‪492936090‬) | OpenStreetMap which means only people with special permissions (like people living there) can use these roads. Therefore GraphHopper does not allow driving there.

Yes, correct… it is due to motor_vehicle=private.

I tested by removing private from restrictedValues:

package com.graphhopper.routing.util;


public class CarFlagEncoder extends AbstractFlagEncoder {


    public CarFlagEncoder(PMap properties) {
        super(properties.getString("name", "car"),
                properties.getInt("speed_bits", 5),
                properties.getDouble("speed_factor", 5),
                properties.getBool("speed_two_directions", false),
                properties.getInt("max_turn_costs", properties.getBool("turn_costs", false) ? 1 : 0));


// I remark the line below
//        restrictedValues.add("private");

and GH routed successfully.

Being a newbie in this field, I can’t guess of the implication of remarking this line though. But I think it’s safe enough for my use case (package delivery), as usually the drivers can find ways to get into private streets at their destinations.
Although, maybe GH will route him through a lot of private streets in between…
Is my thought process correct here?

Yes, your thought process is correct. Instead of commenting out this code you can also achieve the same by using the block_private option for the flag encoder. So if you use vehicle: car in your profile you need to set graph.flag_encoders: car|block_private=false in config.yml. A more sophisticated approach would be setting up a low (but non-zero) priority for these roads. This way the router would avoid private roads, but still use them when they are necessary to reach a destination (or start from some place along such roads).

Tried it and confirmed to be working… Thanks!! :+1: :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.