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 and Thank you for reaching out.
When a route request is submitted, each input coordinate is first snapped to the nearest routable road location based on the selected travel mode .The routing engine then works with these derived, routable points rather than the raw input coordinates.
In most cases, the service can clearly associate each snapped waypoint with a specific input coordinate and returns order.inputIndex accordingly. However, in certain edge cases—such as when a waypoint lies very close to a straight route segment, a junction, or another routable node—the snapped location may not be uniquely attributable to a single input waypoint. When this happens, the route is still calculated correctly, but the service may omit order.inputIndex for that waypoint because a confident one‑to‑one mapping cannot be established.
This also explains the reason for very small coordinate adjustment results in different behavior. Slightly changing the waypoint causes it to snap to a different road segment or node, making it distinct enough for the service to reliably associate it with the original input index. As a result, order.inputIndex appears as expected.
Consider implementing the following steps:
1.Please do not assume that every input waypoint will always produce a response waypoint with order.inputIndex.
2.For scenarios where strict mapping is required, consider,
- Avoiding intermediate waypoints placed exactly on junctions or ambiguous road positions.
- Applying small coordinate offsets to critical waypoints.
- Using proximity‑based matching (within a small tolerance) as a fallback when order.inputIndex is not present.
References:
Route - Post Route Directions - REST API (Azure Maps) | Microsoft Learn
Thank you!
Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the reply was helpful. This will be benefitting other community members who face the same issue.