Trip

Change return type of route coordinates

To reduce the size of the response and increase performance, especially on longer routes, you can use the pointsMode parameter to change how the coordinates should be returned.

pointsMode is a query param and must be added to the endpoint used to search for the route solution.

Allowed values

object

Default coordinate format in Asynchronous Trip, if the parameter is not entered. The route coordinates will be like an object with two keys, latitude and longitude, as in the following example:

Synchronous Trip – https://api.maplink.global/trip/v2/calculations?pointsMode=object
Asynchronous Trip – https://api.maplink.global/trip/v1/solutions/{tripId}?pointsMode=object

"legs": [
        {
            "distance": 856,
            "nominalDuration": 44,
            "averageSpeed": 70.04,
            "points": [
                {
                    "latitude": -15.016381160108912,
                    "longitude": -57.180606412016644
                },
			 //....(Truncado)....
                {
                    "latitude": -15.024091803051613,
                    "longitude": -57.180970134787366
                }
            ],
        }
]

array

The route coordinates will be returned in array format, where the first position refers to the latitude and the second position refers to the longitude, as in the following example:

Synchronous Trip – https://api.maplink.global/trip/v2/calculations?pointsMode=array
Asynchronous Trip – https://api.maplink.global/trip/v1/solutions/{tripId}?pointsMode=array

"legs": [
        {
            "distance": 856,
            "nominalDuration": 44,
            "averageSpeed": 70.04,
            "points": [
                [
                    -12.83504,
                    -38.42209
                ],
			 //....(Truncado)....
                [
                    -12.83475,
                    -38.42198
                ]
            ]
        }
],

geohash

The route coordinates will be returned in string format representing the latitude and longitude encoded in geohash, as in the following example:

Synchronous Trip – https://api.maplink.global/trip/v2/calculations?pointsMode=geohash
Asynchronous Trip – https://api.maplink.global/trip/v1/solutions/{tripId}?pointsMode=geohash

"legs": [
        {
            "distance": 856,
            "nominalDuration": 44,
            "averageSpeed": 70.04,
            "points": [
                "6tr6df675",
	         //....(Truncado)....
                "6tr6dbfn6"
            ]
        }
],

polyline

Default coordinate format in Trip Synchronous, if the parameter is not entered. The route coordinates will all be coded in polyline format , considerably reducing the size of the response and improving performance, as in the following example:

Synchronous Trip – https://api.maplink.global/trip/v2/calculations?pointsMode=polyline
Asynchronous Trip – https://api.maplink.global/trip/v1/solutions/{tripId}?pointsMode=polyline

"legs": [
        {
            "distance": 4272,
            "nominalDuration": 315,
            "averageSpeed": 40.5,
            "points": "nxmmAv_thFLvADJ^`@HNN^BTCj@QbB@bAEV??gKeD_Cy@{@c@wDmBmPuIuX}NwEaC}IyEeVqMyc@_V??m@}@IUa@{CUeCWyD??t@k@tCmCzAiAFOAM{@}A??hB{ArAi@r@Q`AGREd@UZKxBi@|C}A??"
        }
],