I want to avoid specific streets when using the routing API. I have data points to create a geofence or polygon to represent those specific streets. The router API accepts only up to 20 bounding boxes. I tried to send 20 avoid area bounding boxes to represent the road, but the result is not reliable (e.g. on diagonal roads).
Is there a way to send a geofence/polygon instead of bounding boxes? Or any other way to avoid certain streets? Thank you very much
Please try to use
avoid[segments]
instead ofavoid[areas]
for avoiding specific roads. In the case of having too many roads to avoid, you can also put theavoid[segments]
parameters into request body and send aPOST
request to the same endpoint.In order to get the
segmentId
of the roads you would like to avoid, you can do a normal routing call with parameterspans=segmentId
added and then look at thetopologySegmentId
attributes inspans
section of the response.https://developer.here.com/documentation/routing-api/api-reference-swagger.html