'Avoid predefined geo-coordinates when generating a route in Bing Maps

I am trying to discard routes which passes through a predefined latitude and longitude coordinate. Bing maps has the AVOID parameter but doesn't seem to suggest I can use it for points? Instead, only for 'highways, tolls, ferry, tolls and so on...'.

'optimizeWaypoints' only lets you add (stops) to avoid certain places manually. But this is resource intensive to loop through all possible routes, and could be limited to itself only.

I was hoping to add 'danger zones' where the route could be forced to go around the area and even add 1hr travel time if it was the case.

The current documentation doesn't advice for adding these 'avoid' zones(lists of longitudes and latitudes). Could anyone advice a good method? or a hacky way to calculate a route but avoiding predefined points?

bing API: https://docs.microsoft.com/en-us/bingmaps/rest-services/routes/calculate-a-route



Solution 1:[1]

The Bing Maps Route API only allows avoiding predefined road types (highways, tolls...). If you want to avoid specific areas, take a look at the Azure Maps Routing service. It lets you specify areas to avoid in their POST endpoint: https://docs.microsoft.com/en-us/rest/api/maps/route/post-route-directions

You can use the avoidAreas option in the POST body of the request.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rbrundritt