---
title: "POST /route/snapToRoads"
method: POST
path: "/route/snapToRoads"
---

# POST /route/snapToRoads

`POST /route/snapToRoads`

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](https://learn.microsoft.com/azure/azure-maps/routing-coverage?pivots=latest).

## Query parameters

- `api-version` string, required

## Headers

- `x-ms-client-id` string
- `Accept-Language` string

## Response `200`

The request has succeeded.

- SnapToRoadsResponse — This object is returned from a successful call.
  - `type` 'FeatureCollection' — Specifies the `GeoJSON` type. The only supported object type is `FeatureCollection`. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).
  - `features` SnapToRoadFeaturesItem[] — `GeoJSON` feature object that contains Geometry object and additional properties. Refer to [RFC 7946, Section 3.2](https://www.rfc-editor.org/rfc/rfc7946#section-3.2) for details.
    - `type` 'Feature' — Specifies the `GeoJSON` type. The only supported object type is Feature. For more information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).
    - `geometry` GeoJsonPoint — A valid `GeoJSON` geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1) for details.
      - `type` 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon' | 'GeometryCollection' | 'Feature' | 'FeatureCollection', required — Specifies the `GeoJSON` type. Must be one of the nine valid GeoJSON object types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Feature and FeatureCollection.
    - `bbox` number[] — A rectangular area on the earth defined as a bounding box object. The sides of the rectangles are defined by latitude and longitude values. For more information, see [RFC 7946, Section 5](https://www.rfc-editor.org/rfc/rfc7946#section-5). Example: "bbox": [-10.0, -10.0, 10.0, 10.0]
    - `properties` SnapToRoadsFeatureProperties — Snap to Roads properties.
      - `inputIndex` integer — Identify the corresponding index in the original list of points for each snapped point. Only the snapped points will return indices and can be used to distinguish them from the interpolated points.
      - `isInterpolated` boolean — Identify whether this is the interpolated point.
      - `name` string — Name of the road the point is snapped to.
      - `speedLimitInKilometersPerHour` number, double — Speed limit in kilometers per hour.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/maps-route.md) · [All operations](https://skmtc.net/azure/apis/maps-route/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/maps-route/revisions/4b7b4a919999/schema)
