nearest_road
Snap any GPS coordinate to the nearest drivable road. Returns snapped location and distance, enabling accurate route calculation and recovery from off-road waypoints.
Instructions
Find the nearest point on the road network to a given coordinate.
Returns: { lat, lon, distance_m (distance from input to snapped point), road_name }.
WHEN TO USE: Snap waypoints to routable roads before calling route. Also call this if route returns "no route found" — the waypoint may be in a park, building, or off-road area. RECOVERY: If route fails, call nearest_road on origin and destination, then retry route with snapped coordinates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | Yes | Latitude. Range: -90 to 90. | |
| lon | Yes | Longitude. Range: -180 to 180. |