here-api - 使用 Fleet Telematics API 和 vehicleType BUS 获取 Toll 和 KM 的摘要(按国家和收费系统)
问题描述
目前,我们使用 HERE 服务的主要目的是获取每个国家的公里数,以及车辆路线的成本价格(按国家、收费系统等汇总的所有类型的通行费的成本)。
在大多数情况下,我们已经弄清楚如何通过调用 Fleet-telematics API ( https://developer.here.com/documentation/fleet-telematics/api-reference.html , http ://cre.api.here.com/swagger-ui.html?app_id=%7Byour-app-id%7D&app_code=%7Byour-app-code%7D#!/Routing_%26_Route_Matching/calculateRouteUsingPOST
), 经过
- 设置车辆类型(https://developer.here.com/documentation/fleet-telematics/dev_guide/topics/vehicle-types-and-measures.html)
- 设置一些其他参数,特别是“汇总”(以获得“每个国家/地区的成本”和“每个收费系统的成本” - https://developer.here.com/documentation/fleet-telematics/dev_guide/topics/calculation-considerations .html )
我们主要关注公共汽车(和一些汽车)。但是,我们似乎必须使用“TRUCK”而不是“BUS”作为“车辆类型”,否则我们会从您的 API 端点收到错误(“错误请求”-http 状态 400)。
让我举个例子。
用卡车:
https://fleet.ls.hereapi.com/2/calculateroute.json?
apiKey=(REPLACE-API-KEY)
&mode=fastest;truck;traffic:disabled
&departure=2020-07-15T12:00:00
&alternatives=0
¤cy=EUR
&tollVehicleType=3
&waypoint0=46.057745,14.507342
&waypoint1=stopOver!46.232389,15.262164
&waypoint2=stopOver!46.562957,15.638413
&waypoint3=stopOver!47.481128,18.99022
&waypoint4=50.066885,14.380644
&legAttributes=sm
&maneuverAttributes=none
&routeAttributes=none,wp,sm,sc
&linkAttributes=none
&cost_optimize=0
&detail=1
&rollup=none,country;tollsys
坐车:
https://fleet.ls.hereapi.com/2/calculateroute.json?
apiKey=(REPLACE-API-KEY)
&mode=fastest;car;traffic:disabled
&departure=2020-07-15T12:00:00
&alternatives=0
¤cy=EUR
&tollVehicleType=2
&waypoint0=46.057745,14.507342
&waypoint1=stopOver!46.232389,15.262164
&waypoint2=stopOver!46.562957,15.638413
&waypoint3=stopOver!47.481128,18.99022
&waypoint4=50.066885,14.380644
&legAttributes=sm
&maneuverAttributes=none
&routeAttributes=none,wp,sm,sc
&linkAttributes=none
&cost_optimize=0
&detail=1
&rollup=none,country;tollsys
坐巴士:
https://fleet.ls.hereapi.com/2/calculateroute.json?
apiKey=(REPLACE-API-KEY)
&mode=fastest;bus;traffic:disabled
&departure=2020-07-15T12:00:00
&alternatives=0
¤cy=EUR
&tollVehicleType=2
&waypoint0=46.057745,14.507342
&waypoint1=stopOver!46.232389,15.262164
&waypoint2=stopOver!46.562957,15.638413
&waypoint3=stopOver!47.481128,18.99022
&waypoint4=50.066885,14.380644
&legAttributes=sm
&maneuverAttributes=none
&routeAttributes=none,wp,sm,sc
&linkAttributes=none
&cost_optimize=0
&detail=1
&rollup=none,country;tollsys
所有三个 URL(请求)之间的唯一区别是查询参数“mode”和“tollVehicleType”。
当我们在查询参数“mode”中使用“TRUCK”和“CAR”时,答案是可以的(http 状态 200),但是对于“BUS”,我们得到以下错误:
{ "issues": [ { "message": "Router returned no route, error: 400 : {\"_type\":\"ns2:RoutingServiceErrorType\",\"type\":\"ApplicationError\",\"subtype\":\"InvalidInputData\",\"details\":\"Invalid input parameter value\",\"additionalData\":[{\"key\":\"mode\",\"value\":\"fastest;bus;traffic:disabled\"}],\"metaInfo\":{\"timestamp\":\"2020-08-03T08:35:34Z\",\"mapVersion\":\"8.30.111.150\",\"moduleVersion\":\"7.2.202030-7513\",\"interfaceVersion\":\"2.6.76\",\"availableMapVersion\":[\"8.30.111.150\"]}}\n" }, { "message": "Request id: 360cf8bf-a542-4fa9-9198-436cf1c9dbfd" } ], "error_id": "360cf8bf-a542-4fa9-9198-436cf1c9dbfd", "response_code": "400 Bad Request" }
只有当我们完全删除查询参数“rollup”时,我们才能得到“BUS”的 OK 响应。但是这样做,我们丢失了我们真正需要的所有信息(见第 1 段)。
一个额外的相关问题。使用“TRUCK”作为“车辆类型”和“6”(“BUS”)作为“tollVehicleType”或通过查询参数“mode”使用“BUS”作为“车辆类型”之间的主要区别是什么*?
* - 我假设通过使用“TRUCK”(作为“车辆类型”)和“BUS”(“6”)作为“tollVehicleType”,您可能只删除与公共汽车相关的通行费(例如,德国没有通行费高速公路/高速公路,但有卡车),但其他一切(如法规)都与卡车密切相关。另一方面,通过将“BUS”用作“车辆类型”,您可能还考虑了欧盟和其他与 BUS 相关的法规(以及城市限制,例如禁止卡车而不是公共汽车)。这对我们来说是非常重要的功能 - 正确规划路线。
一般来说,在公开可用的文档中,实际上并没有太多与 BUS 类别(作为“车辆类型”)相关的描述或示例。如果您有任何可以分享的内部出版物,我们将非常高兴。
解决方案
推荐阅读
- python - 使用 matplotlib 中的滑块调整散点图中的颜色和颜色图
- javascript - 在相同的输入上调用函数导致循环
- java - Gradle XJC 生成 equals 和 hashCode 方法
- google-sheets - Filter GetRows on GoogleSheet Document via Logic Apps
- java - 由于 java.lang.UnsatisfiedLinkError 导致应用程序崩溃未找到实现
- asp.net - .net core mvc Scaffolding 无法识别我的数据库上下文
- windows - 虚拟共享驱动程序索引问题
- azure - 部署到 Azure VM 后无法写入 Elasticsearch
- java - Docker Elasticsearch线程未捕获异常,绑定服务失败,不支持格式版本
- java - 如何在不使用任何方法的情况下从中缀转换为后缀