{"id":2549,"date":"2023-12-14T21:52:12","date_gmt":"2023-12-14T21:52:12","guid":{"rendered":"https:\/\/developers.maplink.global\/change-return-type-of-route-coordinates\/"},"modified":"2024-02-29T14:27:19","modified_gmt":"2024-02-29T14:27:19","slug":"change-return-type-of-route-coordinates","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/change-return-type-of-route-coordinates\/","title":{"rendered":"Change return type of route coordinates"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">To reduce the size of the response and increase performance, especially on longer routes, you can use the <code>pointsMode<\/code> parameter to change how the coordinates should be returned.<\/p>\n\n<p class=\"wp-block-paragraph\"><code>pointsMode<\/code> is a <em>query param<\/em> and must be added to the endpoint used to search for the route solution.  <\/p>\n\n<h2 class=\"wp-block-heading\">Allowed values<\/h2>\n\n<h3 class=\"wp-block-heading\" id=\"object\">object<\/h3>\n\n<p class=\"wp-block-paragraph\">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:<\/p>\n\n<p class=\"wp-block-paragraph\">Synchronous Trip &#8211; <a href=\"https:\/\/api.maplink.global\/trip\/v2\/calculations?pointsMode=object\"><strong> https:\/\/api.maplink.global\/trip\/v2\/calculations?pointsMode=object<\/strong><br\/><\/a>Asynchronous Trip &#8211; <a href=\"https:\/\/api.maplink.global\/trip\/v1\/solutions\/%7BtripId%7D?pointsMode=object\">https:\/\/api.maplink.global\/trip\/v1\/solutions\/{tripId}<strong>?pointsMode=object<\/strong><\/a><\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"legs\": [\n        {\n            \"distance\": 856,\n            \"nominalDuration\": 44,\n            \"averageSpeed\": 70.04,\n            \"points\": [\n                {\n                    \"latitude\": -15.016381160108912,\n                    \"longitude\": -57.180606412016644\n                },\n\t\t\t \/\/....(Truncado)....\n                {\n                    \"latitude\": -15.024091803051613,\n                    \"longitude\": -57.180970134787366\n                }\n            ],\n        }\n]<\/pre>\n\n<h3 class=\"wp-block-heading\" id=\"array\">array<\/h3>\n\n<p class=\"wp-block-paragraph\">The route coordinates will be returned in <em>array<\/em> format, where the first position refers to the latitude and the second position refers to the longitude, as in the following example:<\/p>\n\n<p class=\"wp-block-paragraph\">Synchronous Trip &#8211; <a href=\"https:\/\/api.maplink.global\/trip\/v2\/calculations?pointsMode=array\"><strong> https:\/\/api.maplink.global\/trip\/v2\/calculations?pointsMode=array<\/strong><br\/><\/a>Asynchronous Trip &#8211; <a href=\"https:\/\/api.maplink.global\/trip\/v1\/solutions\/%7BtripId%7D?pointsMode=array\">https:\/\/api.maplink.global\/trip\/v1\/solutions\/{tripId}<strong>?pointsMode=array<\/strong><\/a><\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"legs\": [\n        {\n            \"distance\": 856,\n            \"nominalDuration\": 44,\n            \"averageSpeed\": 70.04,\n            \"points\": [\n                [\n                    -12.83504,\n                    -38.42209\n                ],\n\t\t\t \/\/....(Truncado)....\n                [\n                    -12.83475,\n                    -38.42198\n                ]\n            ]\n        }\n],<\/pre>\n\n<h3 class=\"wp-block-heading\" id=\"geohash\">geohash<\/h3>\n\n<p class=\"wp-block-paragraph\">The route coordinates will be returned in <em>string <\/em>format representing the latitude and longitude encoded in <em>geohash<\/em>, as in the following example:<\/p>\n\n<p class=\"wp-block-paragraph\">Synchronous Trip &#8211; <a href=\"https:\/\/api.maplink.global\/trip\/v2\/calculations?pointsMode=geohash\"><strong> https:\/\/api.maplink.global\/trip\/v2\/calculations?pointsMode=geohash<\/strong><strong><br\/><\/strong><\/a>Asynchronous Trip &#8211; <a href=\"https:\/\/api.maplink.global\/trip\/v1\/solutions\/%7BtripId%7D?pointMode=geohash\">https:\/\/api.maplink.global\/trip\/v1\/solutions\/{tripId}<strong>?pointsMode=geohash<\/strong><\/a><\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"legs\": [\n        {\n            \"distance\": 856,\n            \"nominalDuration\": 44,\n            \"averageSpeed\": 70.04,\n            \"points\": [\n                \"6tr6df675\",\n\t         \/\/....(Truncado)....\n                \"6tr6dbfn6\"\n            ]\n        }\n],\n<\/pre>\n\n<h3 class=\"wp-block-heading\" id=\"polyline\">polyline<\/h3>\n\n<p class=\"wp-block-paragraph\">Default coordinate format in Trip Synchronous, if the parameter is not entered. The route coordinates will all be coded in <em>polyline <\/em>format <em>, <\/em>considerably reducing the size of the response and improving performance, as in the following example:<\/p>\n\n<p class=\"wp-block-paragraph\">Synchronous Trip &#8211; <a href=\"https:\/\/api.maplink.global\/trip\/v2\/calculations?pointsMode=polyline\"><strong> https:\/\/api.maplink.global\/trip\/v2\/calculations?pointsMode=polyline<\/strong><strong><br\/><\/strong><\/a>Asynchronous Trip &#8211; <a href=\"https:\/\/api.maplink.global\/trip\/v1\/solutions\/%7BtripId%7D?pointMode=polyline\">https:\/\/api.maplink.global\/trip\/v1\/solutions\/{tripId}<strong>?pointsMode=polyline<\/strong><\/a><\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"legs\": [\n        {\n            \"distance\": 4272,\n            \"nominalDuration\": 315,\n            \"averageSpeed\": 40.5,\n            \"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??\"\n        }\n],<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[161],"tags":[],"class_list":["post-2549","post","type-post","status-publish","format-standard","hentry","category-trip-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/comments?post=2549"}],"version-history":[{"count":1,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2549\/revisions"}],"predecessor-version":[{"id":2550,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2549\/revisions\/2550"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}