Distanzmatrix
Routes.matrix
Berechnet paarweise Länge und Fahrzeit zwischen Punkten.
Body-Parameter
| Anfragetext | Typ | Beschreibung |
|---|---|---|
points | double[][] ERFORDERLICH | Array of [x, y] coordinates. |
type | integer ERFORDERLICH | 1 = optimise by time, 2 = by length. |
precise | bool | Exact coordinates (vs. ~500m rounding). Default false. |
simple | bool | true = unique pairs only; false = full each-with-each. |
Beispielrequest
{
"points": [
[
20.5334473,
53.7373403
],
[
17.0178223,
52.33701732
],
[
16.9299316,
51.0603863
],
[
20.8355713,
52.1958233
]
],
"type": 1,
"precise": false,
"simple": true
}Beispielresponse
{
"result": [
{
"length": 482244,
"duration": 229,
"points": "0-1"
},
{
"length": 224693,
"duration": 141,
"points": "0-3"
},
{
"length": 291469,
"duration": 141,
"points": "1-3"
},
{
"length": 539275,
"duration": 309,
"points": "0-2"
},
{
"length": 204062,
"duration": 102,
"points": "1-2"
},
{
"length": 350647,
"duration": 165,
"points": "2-3"
}
]
}result-Felder
| result-Felder | Typ | Beschreibung |
|---|---|---|
points | string | Pair indices, e.g. "0-1". |
length | integer | Length in metres. |
duration | integer | Duration in minutes. |