【问题标题】:GraphHopper vehicle=car works but foot or bike don't workGraphHopper 车辆=汽车工作,但步行或自行车不工作
【发布时间】:2015-11-25 16:58:35
【问题描述】:

我对 GraphHopper 路由引擎稳定版 0.5 有疑问

我可以使用vehicle=car 获取路线,但使用 bikefoot 时会失败。

Here is an example 在 GraphHopper Maps 上步行大约 3 分钟:

这会在地图上产生一个结果,这很棒。

我在本地运行时使用了完全相同坐标,获取JSON数据如下:

http://localhost:8989/routes?point=-33.916567%2C18.417914&point=-33.917584%2C18.418935&locale=en-US&vehicle=foot

这不会产生任何结果,而是返回以下响应:

{
  "message": "Vehicle not supported: foot",
  "hints": [{
    "message": "Vehicle not supported: foot",
    "details": "java.lang.IllegalArgumentException"
  }]
}

请注意,将 vehicle 更改为 car 会产生结果!如何解决这个问题??

为了完整起见,这里是带有 vehicle=car 的示例请求和响应

{
    "paths": [
    {
        "distance": 151.857,
        "time": 18222,
        "points_encoded": true,
        "weight": 151.857451,
        "instructions": [
        {
            "sign": 0,
            "text": "Continue onto Hudson Street",
            "time": 3782,
            "distance": 31.517,
            "interval": [
                0,
                1
            ]
        },
        {
            "sign": -2,
            "text": "Turn left onto Waterkant Street",
            "time": 14440,
            "distance": 120.34,
            "interval": [
                1,
                3
            ]
       },
        {
            "sign": 4,
            "text": "Finish!",
            "time": 0,
            "distance": 0,
            "interval": [
                3,
                3
            ]
        }],
        "bbox": [
            18.417884,
            -33.917672,
            18.418824,
            -33.916712
        ],
        "points": "nj_nEehloBh@l@|@uAvAeB"
        }
        ],
        "hints": {
        "visited_nodes.average": "20.0",
        "visited_nodes.sum": "20"
    },
    "info": {
        "copyrights": [
        "GraphHopper",
        "OpenStreetMap contributors"
        ],
    "took": 10
    }

}

【问题讨论】:

  • 我也遇到了同样的问题。

标签: routing navigation openstreetmap graphhopper


【解决方案1】:

您必须将它包含在您的 config.properties 中

graph.flagEncoders=car,foot,bike

顺便说一句:我已经编辑了您的帖子。要阐明 GraphHopper 路由引擎和 GraphHopper Directions API 之间的区别,请参阅here

【讨论】:

  • 谢谢,这是答案解决方案的一部分。我还必须做的是在重建图形之前删除从 osm.pbf 文件生成的文件夹。
猜你喜欢
  • 2018-10-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-11-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多