使用 HERE 仅使用指定路线计算路线

Calculate route using only specified routes with HERE

我想仅使用城市中可用路线的子集来计算从 A 到 B 的路线,只要可能(如果 A 或 B 不在道路子集上,我仍然需要计算路线)。我尝试使用 avoidareas 但很难定义矩形以避免在道路外(而且我看到某处的方框数量有限)。

能否解释一下 "subset of the routes" 是什么意思?你的意思是要避开某种特定的道路吗? 如果你想总是包含某条道路,你总是可以使用 waypoints 来引导路线通过这些道路。通常,路由算法是针对 "avoid" 而不是 "prefer" 区域设计的。

此处解释了有关如何避免矩形的各种示例- https://developer.here.com/documentation/routing/topics/example-route-avoiding-an-area.html

这里解释了如何使用航点 - https://developer.here.com/documentation/routing/topics/resource-param-type-waypoint.html

这里解释了如何避开某种道路类型 - https://developer.here.com/documentation/routing/topics/avoiding-certain-road-types.html