here-apihere-routing

Here Maps Routing API CountrySummary Difference v7 / v8


I am currently using the Routing v7 API and want to migrate to v8. For my usecase I require a by country separated list of legs as in V7 of the routing API.

Is there a method how I can get the query summary response divided by country as in v7?

https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey=xxx&jsonattributes=9&mode=balanced;truck;traffic:disabled&representation=overview&return=summary,&routeattributes=sc&truckType=truck&waypoint0=53.07537,8.80453&waypoint1=50.54226,9.75617

which will return infos like travelTime, distance, trafficTime,countrycode, tollRoadDistance etc. split by country

cut...
""summaryByCountry": [
      {
        "distance": 343077,
        "trafficTime": 15125,
        "baseTime": 14912,
        "flags": [
          "tollroad",
          "tunnel",
          "motorway",
          "builtUpArea"
        ],
        "text": "The trip takes <span class=\"length\">343 km</span> and <span class=\"time\">4:09 h</span>.",
        "travelTime": 14912,
        "country": "NLD",
        "tollRoadDistance": 341716,
        "_type": "RouteSummaryByCountryType"
      },
       {
        "distance": 169622,
        "trafficTime": 9080,
        "baseTime": 9080,
        "flags": [
          "tollroad",
          "motorway",
          "builtUpArea"
        ],
        "text": "The trip takes <span class=\"length\">170 km</span> and <span class=\"time\">2:31 h</span>.",
        "travelTime": 9080,
        "country": "BEL",
        "tollRoadDistance": 152117,
        "_type": "RouteSummaryByCountryType"
      },
    
...cut

Thanks!


Solution

  • The(summaryByCountry) is not present in v8. But If spans are requested with spans=countryCode,length, then information about the distance in each country can be retrieved. No plans to support in any other manner. Sample V8 query for the same.

    https://router.hereapi.com/v8/routes?transportMode=car&origin=52.5308,13.3847&destination=52.5264,13.3686&return=polyline&apiKey={your_api_key}&spans=countryCode,length

    Please refer the below reference document for the same.

    Migration Guide.

    https://developer.here.com/documentation/routing-api/migration_guide/index.html

    API document.

    https://developer.here.com/documentation/routing-api/api-reference-swagger.html#tag%2FRouting%252Fpaths%252F~1routes%252Fget