How to extract all road data information (maxspeed, road width, nr. of lanes etc...) from HERE API based on coordinates?

Viewed 30

I would like to get as much information as possible about road info by giving the coordinates. So far I use this API url: https://fleet.ls.hereapi.com/2/calculateroute.json with a POST request like this:

  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))

I have this problem: This API uses the above points to first calculate a set of coordinate points (routing) between waypoint0 and waypoint1 and returns road attributes based on the calculated points by the API. I would like to know if there is a way to get road attributes of the road where a SINGLE point belongs to. Like reverse geocode API but in return get the road attributes of the segment the point belongs to. Is there this option in HERE?

0 Answers
Related