GraphHopper.com | Forum | GitHub | Maps | Blog

Pedestrian routing


#1

Hello, i am developing a routing app an i wish to choose when i am calculating the route the “type”(pedestrian, bike or car). My code is:

GHRequest req = new GHRequest(fromLat, fromLon, toLat, toLon).setAlgorithm(Parameters.Algorithms.DIJKSTRA_BI);
req.getHints().put(Parameters.Routing.INSTRUCTIONS, “true”);
GHResponse resp = hopper.route(req);
PathWrapper route = resp.getBest();


#2

Hi,

try req.setVehicle("car"). You also need to import all 3 vehicles in your graph.

Best,
Robin