user2070333 user2070333 - 10 months ago 41
Android Question

Graphhopper Route for Pedestrian android

How do i set route type to Pedestrian in Graphhopper android?
I have been using GHRequest.setVehicle() method in android, and it does not work.
I have tried using "foot", and "bike". None worked. Also, it doesn't work when i changed Algorithms too. Only Dijkstra_BI is working now.

GHRequest req = new GHRequest(fromLat, fromLon, toLat, toLon).

Thanks in Advance.

The map data that i have contain following files. enter image description here

I am getting the following error when I used

tmpHopp.setEncodingManager(new EncodingManager("foot"));

enter image description here

I have solved this problem thanks to karussell. I will write what i did for the people like me who might face this same problem.

What I did

In the graphhopper folder cloned from git, there is a file called In the 5th line. change it to graph.flag_encoders=car,foot,bike



When you import the data (on the desktop/server machine) you have to specify the vehicles you need via graph.flag_encoders=bike,foot,... in the or in older versions graph.flagEncoders=bike,foot,...