thore.com路线API -V8-州里程

发布于 2025-01-30 07:19:36 字数 2547 浏览 2 评论 0 原文

我们正在尝试从路由V7迁移到路由V8。使用V8,我们如何获得每个美国每​​个州的英里拆分?

在版本7.2中,我们可以做

,状态代码将在summaryBycountry element element:

"summaryByCountry": [
    {
        "distance": 189887,
        "trafficTime": 8239,
        "baseTime": 8206,
        "flags": [
            "motorway",
            "builtUpArea"
        ],
        "text": "The trip takes 118 mi and 2:17 h.",
        "travelTime": 8206,
        "country": "South Carolina",
        "_type": "RouteSummaryByCountryType"
    },
...
               

in版本8,类似的请求中,

a href =“ href =” href =“ href =” ://router.hereapi.com/v8/routes?apikey = api_key& rigin = 32.20618,-110.96474& destination = 40.391537,-104.681168 %5bcountries%5D = mex,可以& units = imperial = imperial = polyline,摘要,动作,说明及跨度= countrycode,长度,长度,truckattributes,notic& tark& trunp& trunp& trunp& trunp& track& track& track& "nofollow noreferrer">https://router.hereapi.com/v8/routes?apiKey=API_KEY&origin=32.20618,-110.96474&destination=40.391537,-104.681168&routingMode=fast&transportMode=truck&avoid[features ] =渡轮&排除[国家] = mex,可以& units = impey& return = polyline,摘要,动作,说明及跨度及countrycode = countrycode,length,truckattributes,notices& track& traberc& trailers& amp; via = 1& via = 40.014984,-105.25.2705.270546

"spans": [
    {
        "offset": 0,
        "truckAttributes": [
            "open"
        ],
        "length": 1460740,
        "countryCode": "USA"
    },
    {
        "offset": 14050,
        "truckAttributes": [
            "open",
            "tollRoad"
        ],
        "length": 272,
        "countryCode": "USA"
    },
    {
        "offset": 14053,
        "truckAttributes": [
            "open"
        ],
        "length": 23153,
        "countryCode": "USA"
    }

We're trying to migrate from routes v7 to routes v8. Using v8, how can we get a breakdown of miles per US State?

In version 7.2 we could do

https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey=API_KEY&mode=fastest;truck&excludecountries=MEX,CAN&metricSystem=imperial&routeattributes=sm,sc&instructionFormat=text&truckType=tractorTruck&trailersCount=1&waypoint0=geo!33.90251,-81.13206&waypoint1=geo!39.80203,-105.08759

And the state codes would be in the summaryByCountry element:

"summaryByCountry": [
    {
        "distance": 189887,
        "trafficTime": 8239,
        "baseTime": 8206,
        "flags": [
            "motorway",
            "builtUpArea"
        ],
        "text": "The trip takes 118 mi and 2:17 h.",
        "travelTime": 8206,
        "country": "South Carolina",
        "_type": "RouteSummaryByCountryType"
    },
...
               

In version 8, a similar request:

https://router.hereapi.com/v8/routes?apiKey=API_KEY&origin=32.20618,-110.96474&destination=40.391537,-104.681168&routingMode=fast&transportMode=truck&avoid[features]=ferry&exclude[countries]=MEX,CAN&units=imperial&return=polyline,summary,actions,instructions&spans=countryCode,length,truckAttributes,notices&truck[trailerCount]=1&via=40.014984,-105.270546

"spans": [
    {
        "offset": 0,
        "truckAttributes": [
            "open"
        ],
        "length": 1460740,
        "countryCode": "USA"
    },
    {
        "offset": 14050,
        "truckAttributes": [
            "open",
            "tollRoad"
        ],
        "length": 272,
        "countryCode": "USA"
    },
    {
        "offset": 14053,
        "truckAttributes": [
            "open"
        ],
        "length": 23153,
        "countryCode": "USA"
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一抹淡然 2025-02-06 07:19:36

V7:摘要Bycountry
V8:不存在。如果要求用跨度= countryscode,长度,则可以检索有关每个国家距离的信息。没有任何其他方式支持的计划。
V8中的响应包含:

spans": [
                    {
                        "offset": 0,
                        "truckAttributes": [
                            "open"
                        ],
                        "length": 76817,
                        "countryCode": "USA"
                    }
                ],

链接到迁移指南: https:htttps> https:https:https://开发人员。 ereshy.com/documentation/Routing-api/migration_guide/index.html

v7: summaryByCountry
v8: Not present. 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.
Response in v8 contains :

spans": [
                    {
                        "offset": 0,
                        "truckAttributes": [
                            "open"
                        ],
                        "length": 76817,
                        "countryCode": "USA"
                    }
                ],

link to migration guide : https://developer.here.com/documentation/routing-api/migration_guide/index.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文