api.automapa.comv3 - alle Systeme normal

Distanzmatrix

Routes.matrix

Berechnet paarweise Länge und Fahrzeit zwischen Punkten.

POST/v3/Routes/matrixapi.automapa.com

Body-Parameter

AnfragetextTypBeschreibung
pointsdouble[][] ERFORDERLICHArray of [x, y] coordinates.
typeinteger ERFORDERLICH1 = optimise by time, 2 = by length.
preciseboolExact coordinates (vs. ~500m rounding). Default false.
simplebooltrue = 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-FelderTypBeschreibung
pointsstringPair indices, e.g. "0-1".
lengthintegerLength in metres.
durationintegerDuration in minutes.