v5

latestSwagger 2.02026-07-1310125222.6 KB

The Snap to Roads API accepts GPS point data, represented as longitude and latitude coordinates, and generates points that aligns with existing roadways on a map. This process, known as "snapping to roads", produces a series of objects that trace a path closely following the road network. The resulting data includes road names and their respective speed limits, pertinent to the traversed segments.

Moreover, the Snap to Roads API offers an interpolation feature, which refines the GPS points to create a smoother route that adheres to the road's geometry. This functionality is especially beneficial for asset tracking and enhancing data visualization in mapping applications.

[!Important] The GPS points must be within 6 kilometer of each other.

For information about routing availability in countries/regions, see Azure Maps routing coverage.

post/route/snapToRoads

Query parameters

api-versionstring required

The API version to use for this operation.

Headers

x-ms-client-idstring

Indicates the account intended for use with the Microsoft Entra ID security model. This unique ID for the Azure Maps account can be obtained from the Azure Maps management plane Account API. For more information on using Microsoft Entra ID security in Azure Maps, see Manage authentication in Azure Maps.

Accept-Languagestring

Language in which routing results should be returned.

For more information, see Localization support in Azure Maps.

Response

The request has succeeded.

type'FeatureCollection'

Specifies the GeoJSON type. The only supported object type is FeatureCollection. For more information, see RFC 7946.