How to make sure block_area is always respected?

I have about 200 lat/lon/radius specified in block_area. However, routing does not always seem to respect the values in block_area. When there are a lot of blocked points, routing still passes through the radius of those points. Any idea why?

The green path shows a clear example: https://image.ibb.co/c8ihaT/Screen_Shot_2018_06_22_at_20_48_06.png

Here’s the relevant code snippet using the Web API:

            var ghRoutingAvoid = new GraphHopper.Routing({
                key: "API_KEY",
                vehicle: "foot",
                elevation: false,
                instructions: false,
                ch: {disable: true},
                block_area: "LONG LIST OF LAT,LON,RADIUS"
            });

            setupRoutingAPIAvoid(map, ghRoutingAvoid);

            function setupRoutingAPIAvoid(map, ghRouting) {
                map.setView([52.093421, 5.073712], 12);
                ghRouting.addPoint(new GHInput(52.08986,5.1113));
                ghRouting.addPoint(new GHInput(52.09086,5.1193099));
                ghRouting.doRequest()
                    .then(function(json) {
                        var path = json.paths[0];
                        routingLayerAvoid.addData({
                            "type": "Feature",
                            "geometry": path.points
                        });

                    }).catch(function(err) {
                        console.log(err);
                    });

                var routingLayerAvoid = L.geoJson().addTo(map);
                routingLayerAvoid.options = {
                    style: {color: "#00cc33", "weight": 5, "opacity": 0.6}
                };
            }

There is still an open issue that might be relevant: https://github.com/graphhopper/graphhopper/issues/1324

I.e. it can occur in certain situations that a block_area seems to get ignored. If you have a link to GraphHopper Maps where this is the case I could be investigate if it is a known issue or something else.

Hi @karussell,

thanks for your reply. I cannot judge from the issue whether it is related.

The live example can be found here: http://dj.digitalmethods.net/cams/graphhopper.php?van=stationsplein%2C+utrecht&naar=jansdam%2C+utrecht The red line is a route on foot without block_area, the green line is the same route request but with block_area. No route should ever go through the block_areas. If no route can be found, that’s fine.

It’d be great if you could take a look!

Thanks,

Erik

Thanks for your patience here.

If you can have a look into this request: https://graphhopper.com/maps/?point=stationsplein%2C%20utrecht&point=jansdam%2C%20utrecht%204&ch.disable=true&vehicle=foot

where we can add the block area like so: https://graphhopper.com/maps/?point=stationsplein%2C%20utrecht&point=jansdam%2C%20utrecht%204&ch.disable=true&vehicle=foot&block_area=52.091656,5.11847,10

You see that this works and it also works for multiple arguments: https://graphhopper.com/maps/?point=stationsplein%2C%20utrecht&point=jansdam%2C%20utrecht%204&ch.disable=true&vehicle=foot&block_area=52.091656,5.11847,10;52.090424,5.120369,10