Azure Maps API, NO_ROUTES_FOUND, sometimes work in opposite direction
We are experiencing issues with the Route Matrix endpoint in the Azure Maps API.
Sometimes, the endpoint returns the error "NO_ROUTE_FOUND," even though the coordinates provided appear valid and correspond to typical residential buildings on regular streets. Interestingly, in some cases, the endpoint works correctly if the origin and destination coordinates are reversed.
We have experimented with various query parameters, such as routeType and traffic, but none of these adjustments seem to resolve the problem in the examples provided below.
Could someone clarify why this issue occurs and suggest how to ensure that the endpoint works correctly?
Example 1
This request returns NO_ROUTE_FOUND, but works when the direction is reversed:
Request URL:
POST https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&traffic=false&travelMode=car&routeType=fastest&subscription-key=xxxxx
Body:
{"origins": {"type": "MultiPoint","coordinates": [[12.30949,55.93047]]},"destinations": {"type": "MultiPoint","coordinates": [[12.61083,56.03292]]}}
Response:
StatusCode 400 / Cell could not be processed / NO_ROUTE_FOUND
When the coordinates are reversed, it seems to work:
Request URL:
POST https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&traffic=false&travelMode=car&routeType=fastest&subscription-key=xxxxx
Body:
{"origins": {"type": "MultiPoint","coordinates": [[12.61083,56.03292]]},"destinations": {"type": "MultiPoint","coordinates": [[12.30949,55.93047]]}}
Response:
StatusCode 200 / lengthInMeters: 23901
Example 2
This request always return statuscode 400 / NO_ROUTE_FOUND. Reversing the direction does not work:
Request:
POST: https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&traffic=false&travelMode=car&routeType=fastest&subscription-key=xxxxx
Body:
{"origins": {"type": "MultiPoint","coordinates": [[12.30949,55.93047]]},"destinations": {"type": "MultiPoint","coordinates": [[10.03783,56.46293]]}}
Response:
StatusCode 400 / Cell could not be processed / NO_ROUTE_FOUND
Example 3
Similar to the first example. Only works if the direction is reversed.
Request:
POST: https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&traffic=false&travelMode=car&routeType=fastest&subscription-key=xxxxx
Body:
{"origins": {"type": "MultiPoint","coordinates": [[12.47906,55.79410]]},"destinations": {"type": "MultiPoint","coordinates": [[12.61083,56.03292]]}}
Response:
StatusCode 400 / Cell could not be processed / NO_ROUTE_FOUND
When the coordinates are reversed, it seems to work:
Request:
POST: https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&traffic=false&travelMode=car&routeType=fastest&subscription-key=xxxxx
Body:
{"origins": {"type": "MultiPoint","coordinates": [[12.61083,56.03292]]},"destinations": {"type": "MultiPoint","coordinates": [[12.47906,55.79410]]}}
Response:
StatusCode 200 / lengthInMeters: 34100