BlvckSZN
BlvckSZN

Reputation: 15

Python - HERE Map Attributes - Route calculation

Im trying to make a little app which creates a diversion route around closed roads using the rest api for HERE with python,

im using the: https://cre.api.here.com/2/overlays/upload.json?... https://cre.api.here.com/2/calculateroute.json?... to return a list of lat/long coords

to upload and calculate the best route (please advise if there is a better way)

I was wondering if there was a way to work out the best route but sticking to specific roads for example if the first waypoint was on A road it would stick to an A road, same for B roads etc

Upvotes: 0

Views: 252

Answers (1)

Pankaj Kashyap
Pankaj Kashyap

Reputation: 129

For custom routing you have make two calls. First call to upload the data and second call to display that data. Please use below apis to upload and display the data.

Upload API:

https://fleet.ls.hereapi.com//2/overlays/upload.json?map_name=OVERLAYBASICDEMO1&overlay_spec= [{"op":"override", "shape":[[50.10765,8.68774],[50.10914,8.68771]], "layer":"LINK_ATTRIBUTE_FCn", "data":{"VEHICLE_TYPES":"0"}},{"op":"create", "shape":[[50.10937,8.68422],[50.10807,8.68525],[50.10737,8.68387]],"data":{"NAMES":"ENGBNDemo Road"}}]&app_id={yor_app_id}&app_code={your_app_code} &storage=readonly

API call to display the data:

https://fleet.ls.hereapi.com/2/search/all.json?map_name=OVERLAYBASICDEMO1&geom=full &layer_id=LINK_ATTRIBUTE_FC1,LINK_ATTRIBUTE_FC2,LINK_ATTRIBUTE_FC3,LINK_ATTRIBUTE_FC4,LINK_ATTRIBUTE_FC5 &acceptMissingLayers=true &app_id={your_app_id}&app_code={your_app_code}

Upvotes: 0

Related Questions