Here Maps Routing API CountrySummary 差异 v7 / v8

Here Maps Routing API CountrySummary Difference v7 / v8

我目前正在使用 Routing v7 API 并想迁移到 v8。对于我的用例,我需要一个按国家/地区分隔的航段列表,如路由 API.

的 V7 中所示

有没有一种方法可以像 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

这将 return 旅行时间、距离、交通时间、国家代码、收费公路距离等信息按国家/地区拆分

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

谢谢!

(summaryByCountry) 在 v8 中不存在。但是如果使用 spans=countryCode,length 请求跨度,则可以检索有关每个国家/地区的距离的信息。没有计划以任何其他方式提供支持。 相同的示例 V8 查询。

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

请参考以下参考文档。

迁移指南。

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

API 文档。

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