Calcular una ruta
Routes.route
Encuentra la ruta por una lista ordenada de puntos GPS. Maniobras, tráfico, peajes y restricciones de camión opcionales.
Parámetros del body
| Cuerpo de la solicitud | Tipo | Descripción |
|---|---|---|
points | double[][] REQUERIDO | Ordered list of [x, y] coordinates. |
route | object REQUERIDO | Route options. |
start | string | "YYYY-MM-DD HH:MM" or "NOW". Default NOW. |
type | string | quick | short | optimal. Default optimal. |
traffic | bool | Use live traffic (PL only). Default true. |
desc | bool | Return manoeuvre list. Default false. |
onlyLengthAndETA | bool | Return only length and ETA. |
avoidTolls | bool | Avoid toll roads. |
avoidFerries | bool | Avoid ferries. |
avoidHighways | bool | Avoid motorways/expressways. |
calculateTolls | bool | Compute road tolls. |
vehicleCatForEToll | integer | E-Toll vehicle category 1–5 (PL only, requires calculateTolls). |
object | object REQUERIDO | Vehicle configuration. |
type | string | car | truck | (R) taxi | (R) privileged | (R) bike | (R) walk. |
truckParams | object | Truck dimensions (when type == "truck"). |
axleLoad | double | Axle load (tonnes, ±0.5). |
truckWeight | double | Gross weight (tonnes, ±0.5). |
truckLength | double | Length (m, ±0.5). |
truckWidth | double | Width (m, ±0.5). |
truckHeight | double | Height (m, ±0.5). |
euroNormForToll | integer | Euro emission norm 1–6 (toll calculation). |
Solicitud de ejemplo
{
"points": [
[
20.6350676,
52.1044404
],
[
20.8102593,
52.0933647
],
[
21.0230905,
52.2318032
]
],
"route": {
"calculateTolls": true,
"vehicleCatForEToll": 2,
"start": "NOW",
"type": "short",
"traffic": false,
"desc": true,
"avoidTolls": false,
"avoidFerries": false,
"avoidHighways": false
},
"object": {
"type": "truck",
"truckParams": {
"axleLoad": 2.1,
"truckWeight": 3.5,
"truckLength": 7.2,
"truckWidth": 2.5,
"truckHeight": 3.4,
"euroNormForToll": 5
}
}
}Respuesta de ejemplo
{
"result": {
"length": 37640,
"eta": 60,
"routePoints": [
[
20.6350445,
52.1044257
],
[
20.6382422,
52.1024025
],
[
21.0228726,
52.2318902
]
],
"desc": [
{
"location": "Książenice",
"road": "Mazowiecka",
"roadType": "city_main",
"distance": 5862,
"eta": 10,
"routePoint": [
20.7018437,
52.073707
],
"maneuver": "Roundabout"
},
{
"location": "Warszawa",
"road": "",
"roadType": "internal",
"distance": 22,
"eta": 60,
"routePoint": [
21.022875,
52.2318984
]
}
],
"mapurl": "https://mapa.targeo.pl/trasa_api,1652773689.6283533948f568.51828173"
}
}campos result
| campos result | Tipo | Descripción |
|---|---|---|
length | integer | Total length in metres. |
eta | integer | Predicted travel time in minutes (only when route.desc=true). |
mapurl | string | Link to the rendered route on the map. |
routePoints | double[][] | Polyline of the route as [x, y] points. |
desc[].location | string | Manoeuvre location label. |
desc[].road | string | Road / street name. |
desc[].roadType | string | See roadType enum. |
desc[].distance | integer | Distance from previous point (m). |
desc[].eta | integer | Travel time from the start to this point (min). |
desc[].maneuver | string | Manoeuvre description. |
desc[].routePoint | number[] | Coordenadas [longitude, latitude] (WGS84), si están disponibles. El array desc puede no estar presente. |
tolls.systems | object | Per-operator toll totals. |