An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
Hello @Andrew Martin ,
Welcome to Microsoft Q&A .Thank you for reaching out to us.
After reviewing the reported behavior, the request appears to be reaching the Azure Maps Route Directions service successfully and returning a valid GeoJSON response. The presence of an empty Features array indicates that the service returned a successful response, but no route could be generated for the specified travel mode and routing conditions. This points to a routing outcome rather than a request validation failure.
Based on the behavior currently being observed, a valid route request can return an empty FeatureCollection when a route cannot be generated for the selected travel mode or routing constraints
Please check if the following steps help-
- Verifying the coordinate format
- Confirm that coordinates are being sent in GeoJSON format using [longitude, latitude].
- Since the same locations reportedly work in driving mode, coordinate order appears less likely to be the primary cause. However, validating the raw request payload can help eliminate formatting concerns.
- Comparing truck and driving modes
- Execute the same request using driving mode.
- If driving succeeds while truck mode continues to return an empty route, this strongly suggests a truck-routing restriction, routing coverage limitation, or routability condition
- . Reviewing truck-specific parameters
- If the request includes vehicle dimensions, weight, axle weight, hazardous cargo settings, or commercial vehicle flags, temporarily remove or relax those values and retest.
- This can help identify whether a specific restriction is preventing route generation.
- Testing a simplified itinerary
- Route only from the first location to the second location (A → B).
- Temporarily remove the return leg (A → B → A).
- This can help determine whether a specific segment of the route is contributing to the behavior.
- Validating the optimizeRoute value
- If optimizeRoute is currently configured as "short", consider testing with documented values:
- shortest
- fastestWithoutTraffic
- fastestWithTraffic
- Current documentation does not list "short" as a supported value. While there is insufficient evidence to conclude that this is the root cause, validating documented values can help eliminate an additional variable during troubleshooting.
- If optimizeRoute is currently configured as "short", consider testing with documented values:
Based on the currently available information, the behavior appears most consistent with a truck-routing restriction, routability condition, routing coverage limitation or route-specific constraint rather than a malformed request or validation error.
The following references might be helpful , please check them out
- Route - Post Route Directions - REST API (Azure Maps) | Microsoft Learn
- Best practices for Azure Maps Route service in Microsoft Azure Maps | Microsoft Learn
- Azure Maps Route service coverage - Microsoft Azure Maps | Microsoft Learn
- Migrate Bing Maps Calculate a Truck Route API to Azure Maps Route Directions API - Microsoft Azure Maps | Microsoft Learn
Please let us know if the response was helpful
Thank you