如何根据坐标从HERE API中提取所有道路数据信息(最大速度、道路宽度、车道数量等)



我想通过提供坐标来获得尽可能多的道路信息。到目前为止,我使用这个API网址:https://fleet.ls.hereapi.com/2/calculateroute.jsonPOST请求如下:

url = 'https://fleet.ls.hereapi.com/2/calculateroute.json'
params = {
"waypoint0":"47.2628,3.73926", 
"waypoint1":"47.26274,3.73919",
"attributes":"LINK_FCn(*)",
"apiKey":key,
}
resp = requests.post(url=url, params=params)
#__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
os.chdir(dir_write_unkown_roads)
try:
data = resp.json() 
json_object = json.dumps(data, indent=4)
with open("road_data.json", "w") as outfile:
outfile.write(json_object)

except ValueError as e:
json_object = ""
print('printing code respones',str(resp.status_code))

我有这个问题:这个API使用上面的点来首先计算waypoint0和waypoint1之间的一组坐标点(路由(,并根据API计算的点返回道路属性。我想知道是否有一种方法可以获取SINGLE点所属道路的道路属性。就像反向地理编码API,但反过来获取该点所属路段的道路属性?这里有这个选项吗?

您可以使用我们的HERE地图属性api。HERE地图属性API REST API提供了对丰富的HERE地图内容的简单快速访问,可通过您自己的地图数据无缝扩展。

有关详细信息,请查看以下文档。

https://developer.here.com/documentation/content-map-attributes/dev_guide/index.html

您可以使用以下示例来获取基于纬度、经度的属性。

https://demo.support.here.com/examples/v3/pde_get_any_link_info

最新更新