Snap a coordinate to the nearest road
routing.nearest(RoutingNearestParams**kwargs) -> NearestResult
GET/api/v1/nearest
Snap a coordinate to the nearest road
Snap a coordinate to the nearest road
import os
from plaza import Plaza
client = Plaza(
api_key=os.environ.get("PLAZA_API_KEY"), # This is the default and can be omitted
)
nearest_result = client.routing.nearest(
lat=0,
lng=0,
)
print(nearest_result.geometry){
"geometry": {
"coordinates": [
0
],
"type": "Point"
},
"properties": {
"distance_m": 0,
"edge_id": 0
},
"type": "Feature"
}Returns Examples
{
"geometry": {
"coordinates": [
0
],
"type": "Point"
},
"properties": {
"distance_m": 0,
"edge_id": 0
},
"type": "Feature"
}