api.automapa.comv3 - todos los sistemas normales

Matriz de distancias

Routes.matrix

Calcula longitud y duración por pares entre un conjunto de puntos.

POST/v3/Routes/matrixapi.automapa.com

Parámetros del body

Cuerpo de la solicitudTipoDescripción
pointsdouble[][] REQUERIDOArray of [x, y] coordinates.
typeinteger REQUERIDO1 = optimise by time, 2 = by length.
preciseboolExact coordinates (vs. ~500m rounding). Default false.
simplebooltrue = unique pairs only; false = full each-with-each.

Solicitud de ejemplo

{
    "points": [
        [
            20.5334473,
            53.7373403
        ],
        [
            17.0178223,
            52.33701732
        ],
        [
            16.9299316,
            51.0603863
        ],
        [
            20.8355713,
            52.1958233
        ]
    ],
    "type": 1,
    "precise": false,
    "simple": true
}

Respuesta de ejemplo

{
    "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"
        }
    ]
}

campos result

campos resultTipoDescripción
pointsstringPair indices, e.g. "0-1".
lengthintegerLength in metres.
durationintegerDuration in minutes.