Monika Hoedl
Monika Hoedl

Reputation: 21

Block nodes/edges in graphhopper routing - wrong edges are getting blocked

I'm trying to block edges in my graphhopper routing, following the example described in the docs (https://github.com/graphhopper/graphhopper/blob/master/docs/core/weighting.md). I try to find the edges which have to get blocked with

EdgeIteratorState edge = hopper.getLocationIndex().findClosest(lat, lon, EdgeFilter.ALL_EDGES ).getClosestEdge();

But when running my App, it shows up that some completely different edges are blocked, not the ones I tried to block. What am I doing wrong, do you have any hints? I got stuck with this problem since four days now, no ideas left.

Upvotes: 0

Views: 736

Answers (1)

Monika Hoedl
Monika Hoedl

Reputation: 21

Don't know yet, if this is elegant, but I think I found a workaround: in the config.properties of the graphhopper.sh I added

prepare.chWeighting=no

and while loading the graph, I set

tmpHopp.setCHEnable(false);

To block an edge afterwards, I simply set the speed for this edge to 0

FlagEncoder footEncoder =    TempAppData.getInstance().getHopper().getEncodingManager().getEncoder("foot");
                edge.setFlags(footEncoder.setSpeed(edge.getFlags(), 0));

Upvotes: 0

Related Questions