Graphhopper Route for Pedestrian android

六眼飞鱼酱① 提交于 2019-12-13 02:54:51

问题


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).
                    setAlgorithm(Algorithms.DIJKSTRA_BI).setVehicle("foot");

Thanks in Advance.

The map data that i have contain following files.

I am getting the following error when I used

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

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 config.properties. In the 5th line. change it to graph.flag_encoders=car,foot,bike

Thanks.


回答1:


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 config.properties or in older versions graph.flagEncoders=bike,foot,...



来源:https://stackoverflow.com/questions/37796776/graphhopper-route-for-pedestrian-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!