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

2024-10-17 06:28:34 发布

您现在位置:Python中文网/ 问答频道 /正文

虽然链接here显示Herepy库支持hereapi的自行车路由,但我无法让它工作(而汽车路由工作得很好)。你知道吗

运行时:

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\u route()函数没有正确实现,还是我在这里做错了什么?你知道吗


Tags: key路由here链接carroutebicyclelat2