Azure Maps API, NO_ROUTES_FOUND, sometimes work in opposite direction

Morten Bested 0 Reputation points
2025-01-10T11:48:29.97+00:00

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

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
779 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. rbrundritt 18,826 Reputation points Microsoft Employee
    2025-01-15T18:01:04.3566667+00:00

    The most common reasons for these types of errors are:

    • A route point that is more than 150 meters from a road segment.
    • One way streets sometimes can create issues
    • Incorrect map data.

    That said, I highly recommend trying the new Azure Maps routing service that is in preview as it corrects many of these issues: https://learn.microsoft.com/en-us/rest/api/maps/route?view=rest-maps-2024-07-01-preview

    1 person found this answer helpful.

  2. IoTGirl 3,301 Reputation points Microsoft Employee
    2025-01-25T14:23:11.0533333+00:00

    Further to Ricky's answer, you are calling the Matrix API with only 2 coordinates. In general that API is expecting a matrix of locations. Try the Route API Ricky recommended as it will take only two locations by design.


  3. Faraz Siddiqui 100 Reputation points Microsoft Employee
    2025-01-29T06:58:25.91+00:00

    Hi @Morten Bested

    Example 1 and Example 3 have issues with the destination, which is the same for both examples (12.61083,56.03292). This is most likely due to incorrect one-way restrictions. When you reverse the coordinates, you get a route because it is able to navigate in that direction. You are able to get a route in the Route Directions API because it considers pedestrian connectivity to the destination, which ignores the road restriction issue. However, the route matrix only uses drivable routes and is not able to snap. I will create a bug to get this fixed in the route matrix.

    Example 2 also has issues routing to the destination. In this case, it seems to be missing map data, which prevents the destination from snapping to the closest routable road. As a result, you also don't get a route when you reverse it. It is not due to a ferry connection. I will create a bug for this as well to investigate and get the map updated. I am able to get a route for this example using the Route preview. Could you please give it a try again? I can share the request body if you need.

    The matrix should be able to route to/from the routable geocoded coordinates. These appear to be one-off issues with the map data. If you are blocked by these issues, I recommend moving these points to the nearest road for the meantime so you can get the route. If you have more examples of NO_ROUTE_FOUND, please share them with us. I recommend using the latest Route public preview, which resolves most of these issues, and we currently plan to have this service in GA this quarter. You can always reach out to us through Azure support.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.