## Snap a coordinate to the nearest road `NearestResult Routing.Nearest(RoutingNearestParamsparameters, CancellationTokencancellationToken = default)` **get** `/api/v1/nearest` Snap a coordinate to the nearest road ### Parameters - `RoutingNearestParams parameters` - `required Double lat` Latitude - `required Double lng` Longitude - `Long radius` Search radius in meters (default 500, max 5000) ### Returns - `class NearestResult:` GeoJSON Point Feature snapped to the nearest road segment - `required GeoJsonGeometry Geometry` - `required Coordinates Coordinates` GeoJSON coordinates array (nesting depth varies by geometry type) - `IReadOnlyList` - `IReadOnlyList>` - `IReadOnlyList>>` - `IReadOnlyList>>>` - `required Type Type` - `"Point"Point` - `"LineString"LineString` - `"Polygon"Polygon` - `"MultiPoint"MultiPoint` - `"MultiLineString"MultiLineString` - `"MultiPolygon"MultiPolygon` - `required Properties Properties` - `Double DistanceM` Distance to nearest road in meters - `Long? EdgeID` Road edge ID - `required Type Type` - `"Feature"Feature` ### Example ```csharp RoutingNearestParams parameters = new() { Lat = 0, Lng = 0, }; var nearestResult = await client.Routing.Nearest(parameters); Console.WriteLine(nearestResult); ``` #### Response ```json { "geometry": { "coordinates": [ 0 ], "type": "Point" }, "properties": { "distance_m": 0, "edge_id": 0 }, "type": "Feature" } ```