Snap a coordinate to the nearest road
NearestResult Routing.Nearest(RoutingNearestParamsparameters, CancellationTokencancellationToken = default)
GET/api/v1/nearest
Snap a coordinate to the nearest road
RoutingNearestParams parameters = new()
{
Lat = 0,
Lng = 0,
};
var nearestResult = await client.Routing.Nearest(parameters);
Console.WriteLine(nearestResult);{
"geometry": {
"coordinates": [
2.3522,
48.8566
],
"type": "Point"
},
"properties": {
"distance_m": 12.4,
"edge_id": 0,
"edge_length_m": 0,
"highway": "highway",
"osm_way_id": 0,
"surface": "surface"
},
"type": "Feature"
}Returns Examples
{
"geometry": {
"coordinates": [
2.3522,
48.8566
],
"type": "Point"
},
"properties": {
"distance_m": 12.4,
"edge_id": 0,
"edge_length_m": 0,
"highway": "highway",
"osm_way_id": 0,
"surface": "surface"
},
"type": "Feature"
}