【发布时间】:2022-11-01 18:55:51
【问题描述】:
我想通过给出坐标来获得尽可能多的关于道路信息的信息。 到目前为止,我使用这个 API url:https://fleet.ls.hereapi.com/2/calculateroute.json 和这样的 POST 请求:
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 类似,但作为回报获取点所属路段的道路属性。这里有这个选项吗?
【问题讨论】: