如何在 Graphhopper android 中将路线类型设置为行人? 我一直在 android 中使用 GHRequest.setVehicle() 方法,但它不起作用。 我试过使用“脚”和“自行车”。没有工作。此外,当我也更改算法时它不起作用。现在只有 Dijkstra_BI 在工作。
GHRequest req = new GHRequest(fromLat, fromLon, toLat, toLon).
setAlgorithm(Algorithms.DIJKSTRA_BI).setVehicle("foot");
提前致谢。
我在使用时遇到了以下错误
tmpHopp.setEncodingManager(new EncodingManager("foot"));
感谢 karussell,我已经解决了这个问题。我会写下我为像我这样可能面临同样问题的人所做的事情。
我做了什么
在从 git 克隆的 graphhopper 文件夹中,有一个名为 config.properties 的文件。在第 5 行。将其更改为 graph.flag_encoders=car,foot,bike
谢谢。
最佳答案
当您导入数据(在桌面/服务器机器上)时,您必须通过 graph.flag_encoders=bike,foot,...
在 config.properties 或旧版本 graph.flagEncoders=bike,foot,...
关于android - Graphhopper 行人路线 android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37796776/