在 Herepy 中实现自行车路由功能的 AttributeError

AttributeError implementing Bicycle Routing function in Herepy

虽然 link here 显示 Herepy 库支持 Here-API 的自行车路线,但我无法让它工作(而汽车路线很好)。

当运行:

import herepy

#https://herepy.readthedocs.io/en/latest/herepy.html

lat1,lng1 = 45.575402, -73.209555
lat2,lng2 = 45.595625, -73.619487

routingApi = herepy.RoutingApi('a key', 'another key')
byCar = routingApi.car_route([lat1,lng1],[lat2,lng2],[herepy.RouteMode.car, herepy.RouteMode.fastest])
byBike = routingApi.bicycle_route([lat1,lng1],[lat2,lng2])

我得到:

AttributeError: 'RoutingApi' object has no attribute 'bicycle_route'

是bicycle_route()函数没有正确实现,还是我这里做错了什么?

看起来像这个功能was just added recently,尝试从源安装最新版本,即:

  1. 克隆the repo
  2. 运行 python setup.py install