Road route between places
get_routeUse this when the user wants the driving, walking or cycling route between 2 to 25 places or points in order: the distance and travel time along the roads and paths, per leg and in total, and the route line. Computed by Valhalla on the TerraLab server from the OpenStreetMap road network, with each road's typical speed. Options avoid tolls, highways or ferries. Returns the figures (distance_m, distance_km, duration_s, duration_min), a map of the line and GeoJSON, KML, GPX, Shapefile zip and GeoPackage downloads. Not for a straight-line distance (use measure), live traffic, departure-time travel times, public transport or turn-by-turn navigation. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. Never pass these links to open_gis_file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | How the route is travelled. | driving |
| points | Yes | Start, optional stops and destination, in travel order: place names or {latitude, longitude}. | |
| avoid_tolls | No | Driving: avoid toll roads where a reasonable alternative exists. | |
| avoid_ferries | No | Avoid ferries where possible. | |
| avoid_highways | No | Driving or cycling: avoid motorways and highways where possible. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Error code, on errors only. | |
| hint | No | What to do next, on errors only. | |
| message | No | Error message, on errors only. | |
| sources | No | Data sources and licences of the result. | |
| downloads | No | Download links; each builds its file when opened. | |
| truncated | No | ||
| totalFound | No |