【问题标题】:Problems with truck route violation卡车路线违规问题
【发布时间】:2021-01-20 19:39:00
【问题描述】:

我们正在使用卡车路线,但遇到了一个问题,我们不确定卡车路线违规是如何触发的。 以下文档页面上的示例:

https://developer.here.com/documentation/routing/dev_guide/topics/example-truck-route-violating-restriction.html

如果您发送以下请求:

https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey={YOUR API KEY}&mode=fastest;truck&waypoint0=geo!52.534924,13.199499&waypoint1=geo!52.534614,13.199362&height=5&truckRestrictionPenalty=soft&routeattributes=notes&maneuverattributes=notes

您会看到有一个 note 属性来表明存在违规。然而,如果您尝试执行另一个请求(除了文档中的示例),您将看到“note”属性变空(没有违规)。我们正在使用从曼哈顿到泽西市通过桥梁的路线,使用参数 width=50、height=50 和 length=150 穿过狭窄的街道。这是请求:

https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey={YOUR API KEY}&mode=fastest;truck&waypoint0=geo!40.71650771367789,-74.00330338450901&waypoint1=geo!40.78629608681962,-74.0084639992997&height=50&width=50&length=150&truckRestrictionPenalty=soft&routeattributes=notes&maneuverattributes=notes

然而,您会看到 note 属性为空,这意味着尚未触发违规,尽管极端参数肯定会触发违规。

您能否向我们解释一下具体是如何触发违规的?如果想要实现该请求,该请求应该是什么样的?

【问题讨论】:

    标签: routes here-api


    【解决方案1】:

    这是因为路由算法能够找到满足您的条件而不会违反的路由。如您所见,当您提供的高度超过桥梁的允许限制时,它已重新布线(不通过桥梁的路线)。

    但是,如果您强制它通过桥梁(通过添加它有一个航路点),那么它会按预期给出违规行为。

    https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey={your-api-key}&mode=fastest;truck&waypoint0=geo!40.71650771367789,-74.00330338450901&waypoint1=40.763687,-74.010802&waypoint2=geo!40.78629608681962,-74.0084639992997&height=50&width=50&length=150&truckRestrictionPenalty=soft&routeattributes=notes&maneuverattributes=notes

    上面的查询强制路由通过桥(waypoint1=40.763687,-74.010802)。您可以在响应中找到以下违规行为:

    【讨论】:

      猜你喜欢
      • 2021-05-15
      • 2018-10-27
      • 2020-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多